Export to excel with variable filename

goldenvision

Board Regular
Joined
Jan 13, 2004
Messages
234
--------------------------------------------------------------------------------

Various posts on here seem to have flirted with the answer I am looking for but I can't seem to find anything specific. Any help would be appreciated.

I am looking to export a paramatised query to excel with a variable file name.

i.e. H:\Projects\CrosstabExport - [paramater value].xls

The threads dealing with adding a date to a file name seem to hint that this is possible but I'm not sure how to go about it.

Thanks in advance.
 
I have changed it to use the form which paramatises the query. This was working fine but it was outputing the concession reference number rather than the name but I managed to get around this by using .Column(2) at the end of the string, so everything is working great now.

Thanks for all of your help.

(y)
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Re: Export to excel

I'm hoping you might be able to help me. I have a simple access query. I was using the following command onclick:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "1099 Export", "test ramquest export.xls", yes

problem is that it give me an error about the version that the excel file is in. It wasnt doing that before, but now it is.

Other problem is that it doesnt seem to over write the data.

If I choose 02/01/04 as the start date parameter, and 08/01/04 as the end, I get that data. But when I make the end date 05/01/04 or something, it still shows for dates through to 08/01/04.

What can I do to have it overwrite the data?
Any help is appreciated.... :pray:
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,132
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top