Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autosave transfered Access records in Excel

Status
Not open for further replies.

geralf

Technical User
Apr 7, 2003
44
MX
Hi,
I'm transfering records from Acces to Excel (using the Excel 9.0 library - not TransferSpreadsheet Method). The filename of the workbook is construv\cted based on month and year, for instance Feb2003.xls

If the file don't exist, I'd like it to be created, but without the user being able to change the filename. Can this be done, and if so how?

All has to be done from Access VBA.

Thanks in advance for any help


Regards
Gerhard
 
Just use the SaveAs method of the workbook object:

objWorkbook.SaveAs "C:\file.xls"

hth

B

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Thanks for your help (again) Ben O. harab! Much appreciated. I'm new to the Excel Object Library, so basic help is needed in this matter. Worked very well. Thanks again!

Regards
Gerhard
 
Basically, anything you want can do in Excel code you can automate in Access code using the Excel library.
What I often do is record a macro in Excel doing what I need, then look at the code and use that as a basis for my Access code.

hth

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top