Yes, Bob, I read your post and read the site you posted.
First, thanks for letting me know about Analyze with Excel.
But, I would not recommend doing it that way. First, it is a poor
implementation of Automation. There are serious problems with the posted
solution. It does not quit the Xl application, so it will be left running.
It explicitly uses CreateObject which, if the user already had an instance of
Excel running could confuse Access and maybe close the user's instance and
loose her work. And, there would be no column headers.
And lastly, why go to all that trouble when a simple TransferSpreadsheet
would work?
I suggest you rewrite your code.
--
Dave Hargis, Microsoft Access MVP
Bob Larson via AccessMonster.com said:
Did you bother looking at the link that I posted? It would actually be very
easy to modify that code to do what you want it to do.
Klatuu,
I don't mean to export the data to Excel, but rather a command button to
analyze the current data in form view to Excel just like the button in the
toolbar "Analyze it with Microsoft Office Excel" function.
To export data to Excel, you use the TransferSpreadsheet action or method.
It only accepts the names of tables and queries, so it will not accept your
[quoted text clipped - 8 lines]
command button to export the filtered records to MS Excel? I tried the button
wizard, but did not see any option to export data. Thanks
--
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at
http://www.btabdevelopment.com
__________________________________
Access 2000, 2002, 2003, 2007