Jerry-
Many of us who have wrestled with Office Automation would rather use "late binding" and not need the library reference at all. You must explicitly declare any Excel constants you use and instead of:
Dim objExcel As Excel.Application
do:
Dim objExcel As Object
Then to start the whole process do:
Set objExcel = CreateObject("Excel.Application")
That will dynamically bind to the "latest" version of Excel installed on the machine, and unless you're doing something specific to V 14, your code should fly just fine against any version back to about V8 or so.
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Feb 6, 2014, at 5:22 PM, Jerry Mathers <jerrymathersasthebeav@yahoo.com> wrote:
Okay, this time I've got it right--I have an Access question! :-)
I found some VBA code that does exactly what I need in that it sends Query results to an Excel file. The code requires that the Microsoft Excel 14.0 Object Library is available. By default it seems to be unchecked so I've gone in and checked it. Once I do that everything works. But, what I need to do is find a way to "check" this reference on other people's computers who will be using the Access database. There's no way I'd be able to get them to do that the the way I had to so I'm wondering if there is a way to do this with some VBA so they won't have to get into the guts of the database to turn on the Excel Library Reference.
Thanks for any help you can offer!
Jerry
__._,_.___
| Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (3) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar