How to create an Excel worksheet through VB6 without an Excel object?

Recently, I was made responsible for updating the VB6 data collection application to add the ability to generate Excel reports and print them through the application (both must run on the same computer). This is usually not a problem; I created Excel reports with VB6 before using the Excel object.

So, I went ahead and coded the changes and presented them, and then I was told that the machine on which this program would not be indicated would not have a full copy of Excel on it, and I had to come up with another solution.

I tried to create delimited files (separated by commas or text), but when these files are opened with excel, they are not formatted beautifully, i.e. if one cell has 20 characters, half of the fragments will be disabled due to the size of the fixed cell.

I have some more ideas:

1) I know that openoffice has an api. Can this api be used to create a properly formatted excel file? Is there a COM object that I can use?

2) I found this tool: http://www.carlosag.net/Tools/ExcelXmlWriter/ However, it was written in VB.NET. Can I use this tool in VB6?

, . - utitiles ? , / . , , !

. Excel, , - Excel 2007

+3
10

:

DLL, Excel. , , XML, VB6.

-1

:

Excel .

, isntalled [sic] Excel

, . , , , SpreadSheetML.

SpreadSheetML: , SpreadSheetML Xml-, Excel Office 2007. SpreadSheetML OfficeXP Office 2000.

+4

excel html. - , excel, html , , excel-. /vnd.ms-excel. Excel . , - .

, , , , , xml.

+1

CSV, .

, XLS, .

+1

.NET, №2 .NET, COM. ExcelXMLwriter.

XML , , , .

OpenOffice, . VBA . , COM-, .

0

Excel Excel ** Jet - Jet - "make table" SQL DML CREATE TABLE SQL DLL, Excel, VBA:

Dim cat
Set cat = CreateObject("ADOX.Catalog")
With cat  

  ' Create a new Jet .mdb
  .Create _
      "Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=" & _
      Environ$("temp") & "\DropMe.mdb"
  ' Use .mdb Jet connection to create an Excel table
  ' (will create a new workbook to contain it)
  .ActiveConnection.Execute _
     "CREATE TABLE" & _
     " [Excel 8.0;HDR=NO;Database=C:\db.xls;].[Sheet1]" & _
     " (col FLOAT);"
End With

Jet - Windows, Windows Vista MS MDAC.

, " [Excel], Excel!

** , : Excel, !

0

SpreadsheetML VB6 . , xml. , SpreadsheetML WordML MSDN.

60 vb.net, SpreadsheetML. - , Excel 2007. excel SpreadsheetML .xls, 2003 . Excel 2007 , , . . SpreadsheetML .xml, Excel 2007 - . XML-, xml, IE , Excel 2003.

0
source

I use NPOI. It does not use excel library and gives output in excel 2003 format.

0
source

I will also go with the CSV option. No DLL or other type of object required. One caveat should be VERY careful about formatting your numbers, because a value of 1,024.00 would create two columns and go through the whole book. it will be formatted as something like Format (Numberfield, "#########. # 0")

0
source

Source: https://habr.com/ru/post/1704674/


All Articles