I have a macro that exports a table with formatting, but that creates a new excel wordbook, i was wondering if their is any way of exporting it to an existing workbook
I have a macro that exports a table with formatting, but that creates a new excel wordbook, i was wondering if their is any way of exporting it to an existing workbook
I don't know about macros but in VBA if you use an existing file to export to then it will create another tab (or overwrite one with the same name). Can you specify an existing file name in the macro?
COuld you please explain how to do it in VBA
Start typing this code and Access will tell you what is required:
DoCmd.TransferSpreadsheet ....
One thing it will ask you for is the file name. Sometimes it is easier to define that first - makes the code easier to read:
Dim FileName as String
FileName="C:\......"
Then in the DoCmd you can reference FileName instead of typing out the whole path name. Don't put quotes around it like you will need for the query/table name.