TransferSpreadSheet

border20

Registered User.
Local time
Today, 20:34
Joined
Jan 8, 2003
Messages
92
I have the folowing code that works fine

Docmd.TransferSpreadsheet acExport, 8, "Queryname", "x:\database\export.xls", False

the problem is that X is a network drive, and the database is runed form different computer with different drive names...

The target excel document is in the same folder as th DB... so I need to refer to the reletive path... so i tried this :

Docmd.TransferSpreadsheet acExport, 8, "Queryname", "export.xls", False

and

Docmd.TransferSpreadsheet acExport, 8, "Queryname", "\export.xls", False

but none worked
can anyone help ?
 
Use the unc path rather than the mapped network drive.

This (as in your case) can differ from machine to machine.
 
You can solve the problem by using the UNC name of the server path rather than a hardcoded drive letter:

\\servername\path\xxx.mdb

This is also how any linked tables should be referenced. It is simply too difficult to force all users to use the same drive letter when mapping to your db.
 

Users who are viewing this thread

Back
Top Bottom