Exporting to Excel with Autofilter

G

Guest

I didn't even know this was possible, but it's been happening and in this
instance, I don't want it. I'm exporting a number of queries daily using the
following code:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "queryName",
"\\server\share\folder\Filename_" & Format(Date, "mmddyy") & ".xls", ,
"queryName"

This gives me an running histrory of files with the date as part of the
filename for each different query. I must point out, there is no template
file. Access is generating the Excel file on it's own.

With that said, one set of files seems to have the autofilter switched on
and automatically filtering on a column. I can't tell what it's filtering
for, but when someone first opens the file, it appears to be empty except for
the column headers in the first row. Unfiltering the column reveals the
hidden data.

As I stated above, I didn't know you could export a spreadsheet with an
autofilter on and one column pre-filtered w/o using a template.

How is this happening, and how do I stop it?
 
K

Ken Snell \(MVP\)

Try exporting without the Range argument:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "queryName",
"\\server\share\folder\Filename_" & Format(Date, "mmddyy") & ".xls"


Does that make a difference?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top