Write xlsx file without Office installed

24 views
Skip to first unread message

Auntie Jack

unread,
Apr 22, 2021, 7:29:42 AMApr 22
to
I've got an Access runtime on a machine without Office installed.

I want to export data to an xlsx file, but all the builtin methods - TransferSpreadsheet, OutputTo, SQL directed to Excel file, ADODB connection to Excel, table built in Excel - are either dependent on an Excel object, or use a driver that is disabled by Microsoft in the current version.

It seems the only 2 options I have are:
Install Excel, or
Find a DLL that will do the job for me, or
Find some very fancy VBA code.

Well, there are tonnes and tonnes of solutions in C# and .NET out there, but none of them are available to VBA. IronXL, NPIO, SpreadsheetLight, ClosedXML: they all have DLLs but are not COM enabled as far as I can tell.

Does anybody know of an out-of-the-box solution that I can use in VBA?

(BTW sorry I haven't posted here since 2009 - been busy).

Thanks,

Jack

Ron Weiner

unread,
Apr 22, 2021, 9:43:26 AMApr 22
to
Auntie Jack formulated the question :
Third option: Export to a CSV. You can use TransferText to do it.

DoCmd.TransferText acExportDelim, , [QueryName], [OutfileName], True

Excel is pretty accommodating with CSV files, so in most cases this
will come down to a teeny, tiny bit of user training and you are good
to go. On my PC Excel is the Default app for CSV files. I am not sure
if that is some setting I made years ago or is a standard thing with
default Office installations.

--
This email has been checked for viruses by AVG.
https://www.avg.com

Auntie Jack

unread,
Apr 23, 2021, 9:34:43 AMApr 23
to
Thanks for the suggestion Ron! Can't go with CSV unfortunately, as we will be given some Excel templates by clients which we'll be dumping data into.

Also, I like your 'teeny, tiny bit of user training'! We won't know most of our users, so even a teeny tiny bit of training is too much!

Ron Weiner

unread,
Apr 23, 2021, 5:22:13 PMApr 23
to
Auntie Jack wrote :
In this case you might want to attack the problem from the Excel side,
and allow the users with Excel to suck data out of the Access database.
It's obvious that the user(s) on the computer(s) without Excel will
not be able to view or manipulate the data.

Rdub

Ulrich Möller

unread,
Apr 23, 2021, 7:19:09 PMApr 23
to
Hi Ron,
would you please turn off the advertising for AVG in your replies?

Thanks

Ulrich

Ulrich Möller

unread,
Apr 23, 2021, 7:23:58 PMApr 23
to
Hi Jack,
if you obviously want to make money with your application and need Excel
to do so, why look for third party vendors instead of purchasing a
license for Excel?

Ulrich

Ron Weiner

unread,
Apr 23, 2021, 7:38:15 PMApr 23
to
Ulrich Möller formulated on Friday :
Hmmmm... I didn't even notice that AVG was attaching their blurb to out
going posts. I rummaged around in the AVG and think I found and turned
off the setting that seems to be annoying you. I guess after I hit
send we'll find out for sure.

Ulrich Möller

unread,
Apr 24, 2021, 3:08:29 AMApr 24
to
Hallo Ron,
Looks like the blurb is gone now. Thanks a lot!

Ulrich

Ron Paii

unread,
Apr 26, 2021, 5:30:55 PMApr 26
to
If the template is a simple table like worksheet with or without headers; try linking to the file and edit it like a table. I don't know what will happen to formatting or formulas. Otherwise you could try installing a 3rd party spreadsheet like OpenOffice and use it's API.
Reply all
Reply to author
Forward
0 new messages