By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Problem with Reserved Character in TransferSpreadsheet method

P: n/a
Hello Everybody,

I am using the TransferSpreadsheet method to import spreadsheets for
processing.

say my code looks like this:

DoCmd.TransferSpreadsheet acImport, 0, _
"tbltempImport1", "" & strFileExtn, False, "Spreadheet1!A1:D30"

No Problem There.

However, if it looks like this:

DoCmd.TransferSpreadsheet acImport, 0, _
"tbltempImport2", "" & strFileExtn, False, "Spreadheet2 !A1:D30"

If fails.

What is the difference?
There is a space at the end of Spreadsheet2 I can't change the way
these are named.

So my query is this.

1 Can I get around the problem of TransferSpreadsheet choking when
there is a space at the end of the spreadsheet (tab) name.

2 How do I rename the sheet in Excel from Access.
Thanks a million guys.

O'Donnell
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Have you tried putting single quotes around the spreadsheet name like this:

DoCmd.TransferSpreadsheet acImport, 0, _
"tbltempImport2", "" & strFileExtn, False, "'Spreadheet2 '!A1:D30"

It's the appropriate reference syntax for a sheet name with spaces in Excel.

Jude

sp*******@hotmail.com (O'Donnell Tribunal) wrote in message news:<a9**************************@posting.google. com>...
Hello Everybody,

I am using the TransferSpreadsheet method to import spreadsheets for
processing.

say my code looks like this:

DoCmd.TransferSpreadsheet acImport, 0, _
"tbltempImport1", "" & strFileExtn, False, "Spreadheet1!A1:D30"

No Problem There.

However, if it looks like this:

DoCmd.TransferSpreadsheet acImport, 0, _
"tbltempImport2", "" & strFileExtn, False, "Spreadheet2 !A1:D30"

If fails.

What is the difference?
There is a space at the end of Spreadsheet2 I can't change the way
these are named.

So my query is this.

1 Can I get around the problem of TransferSpreadsheet choking when
there is a space at the end of the spreadsheet (tab) name.

2 How do I rename the sheet in Excel from Access.
Thanks a million guys.

O'Donnell

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.