ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   creating excel doc without office (https://www.excelbanter.com/excel-programming/329521-creating-excel-doc-without-office.html)

piotr

creating excel doc without office
 
Hi,

Is there any way to create excel doc using script techniques without having
office or ms excel itself installed (the way you can create mdb not having
ms access)

Regards
Piotr



AA2e72E

creating excel doc without office
 
Unlike an access MDB which can exist without any user content (tables etc),
an Excel workbook must have at least one worksheet in it. You can use the Jet
provider to create it with vbscript. I have the code in JScript:

var ADO = WScript.CreateObject('ADODB.Connection');
/* Note \\ */
ADO.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\XLSCreateJSx.XLS;Jet OLEDB:Engine Type=23;Extended
Properties=Excel 8.0");
ADO.Execute("CREATE TABLE [APL DATA] (fldText Char,fldDate Date,fldDouble
Double,fldCurrency Currency,fldBoolean Bit,fldMemo LongChar)");
ADO.Execute("INSERT INTO [APL DATA] VALUES('Ajay','01/01/2004',
32.45,90,1,'Long Text')");
ADO.Execute("INSERT INTO [APL DATA] VALUES('Askoolum',32767,
32.45,90,0,'Long Text')");
ADO.Close;
ADO=null


"piotr" wrote:

Hi,

Is there any way to create excel doc using script techniques without having
office or ms excel itself installed (the way you can create mdb not having
ms access)

Regards
Piotr




piotr

creating excel doc without office
 
Thanks,


Użytkownik "AA2e72E" napisał w
wiadomości ...
Unlike an access MDB which can exist without any user content (tables

etc),
an Excel workbook must have at least one worksheet in it. You can use the

Jet
provider to create it with vbscript. I have the code in JScript:

var ADO = WScript.CreateObject('ADODB.Connection');
/* Note \\ */
ADO.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\XLSCreateJSx.XLS;Jet OLEDB:Engine Type=23;Extended
Properties=Excel 8.0");
ADO.Execute("CREATE TABLE [APL DATA] (fldText Char,fldDate Date,fldDouble
Double,fldCurrency Currency,fldBoolean Bit,fldMemo LongChar)");
ADO.Execute("INSERT INTO [APL DATA] VALUES('Ajay','01/01/2004',
32.45,90,1,'Long Text')");
ADO.Execute("INSERT INTO [APL DATA] VALUES('Askoolum',32767,
32.45,90,0,'Long Text')");
ADO.Close;
ADO=null


"piotr" wrote:

Hi,

Is there any way to create excel doc using script techniques without

having
office or ms excel itself installed (the way you can create mdb not

having
ms access)

Regards
Piotr







All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com