something wrong with exporting to excel and replacing existing fil

G

Guest

I know how to export the access>>excel. But I'm having a problem. My access
file (query) is most updated with the correct data. But when I export to an
excel sheet (replacing an exiting excel file), it says the file will replce,
but it is not replacing. In other words, the export function seems to be
working, but not with the most updated data. When I export and save the
excel speardsheet as a new file, it exports correctly with all necessary
data. When I choose the 'replace' function to replace existing file, it
either isn't exporting everything or is not replacing the file for some
reason. I don't get any error message. The only message I get is "Do you want
to replace the existing file?", which means that the export function is
working....is there something with the existing excel file that I'm trying to
replace that is causing this?

Would anyone know the reason why there is a problem with this?

Thank you very much in advance.
 
S

strive4peace

before you do your export...

~~~~~~~~~~~~~~~~~~~

dim mFilename as string
mFilename = "c:\data\spreadsheets\ExcelDoc.xls" 'whatever

if len(Dir(mFilename)) > 0 then
Kill mFilename
end if
~~~~~~~~~~~~~~~~~~~

so, in other words, delete the file first!

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
S

strive4peace

you're welcome ;) happy to help

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 

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