TransferSpreadsheet Run time Error 3125 (1 Viewer)

aziz rasul

Active member
Local time
Today, 05:10
Joined
Jun 26, 2000
Messages
1,935
I have the following code: -

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblIREMarginalReportTemp", _
"M:\MS Excel Files\GP\Ireland\Ire Wk 2 2006\IRE MR 2 06.xls", False, "'Working Document'!"

When I run the code I get the error: -

Run-time error '3125':

"Working Document'$' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long.

Does anyone understand why I get this?
 

namliam

The Mailman - AWF VIP
Local time
Today, 06:10
Joined
Aug 11, 2003
Messages
11,696
It is probably the ! ...

It should either not be there or be within the single quotes

Greets
 

aziz rasul

Active member
Local time
Today, 05:10
Joined
Jun 26, 2000
Messages
1,935
Silly me. It should have been

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblIREMarginalReportTemp", _
"M:\MS Excel Files\GP\Ireland\Ire Wk 2 2006\IRE MR 2 06.xls", False, "'Working Document!'"

i.e. inside the single quotes.

Thanks.
 

namliam

The Mailman - AWF VIP
Local time
Today, 06:10
Joined
Aug 11, 2003
Messages
11,696
sometimes I have simular problems... :rolleyes:
 

Users who are viewing this thread

Top Bottom