ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Access converts "!" to "$" (https://www.excelbanter.com/excel-programming/413155-access-converts-%24.html)

ragtopcaddy via OfficeKB.com

Access converts "!" to "$"
 
I am trying to use TransferSpreadsheet to export data to a template workbook.
Here is my code:

DoCmd.TransferSpreadsheet _
TransferType:=acExport, _
SpreadSheetType:=acSpreadsheetTypeExcel9, _
TableName:="qryLeaseEventStores", _
FileName:=strRptPath, _
HasFieldNames:=True, _
Range:="LeaseEvents!A3"

When I run it, I get the following error msg:

Run-time error '3126':

''Lease Events'$A3' is not a valid name.

Any ideas? I've done similar transfers dozens of times and never had this
problem before.

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200806/1


Rick Rothstein \(MVP - VB\)[_2180_]

Access converts "!" to "$"
 
I've not used TransferSpreadsheet myself, but those quote marks around the
Range argument look suspicious to me. Try it with that last part like
this...

Range:=LeaseEvents!A3

and see if that works.

Rick


"ragtopcaddy via OfficeKB.com" <u9289@uwe wrote in message
news:8636e4a6eb8d2@uwe...
I am trying to use TransferSpreadsheet to export data to a template
workbook.
Here is my code:

DoCmd.TransferSpreadsheet _
TransferType:=acExport, _
SpreadSheetType:=acSpreadsheetTypeExcel9, _
TableName:="qryLeaseEventStores", _
FileName:=strRptPath, _
HasFieldNames:=True, _
Range:="LeaseEvents!A3"

When I run it, I get the following error msg:

Run-time error '3126':

''Lease Events'$A3' is not a valid name.

Any ideas? I've done similar transfers dozens of times and never had this
problem before.

--
Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200806/1




All times are GMT +1. The time now is 07:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com