Export from ACCESS: DoCmd.TransferSpreadsheet acExport - size of the exported table name restriction

esoestemp

New Member
Joined
Apr 14, 2015
Messages
7
Hello MS Access experts,
I try to optimize a DB using exporting with DoCmd.TransferSpreadsheet function.
I have the following issue - it seems there is a restriction about the number of the symbols in the name.
For example when qry_Name_to_export consists more than 24 symbols I get an error:

[" is not an valid name. Make sure it does not include invalid characters or punctuation and that it is not too long
]

Below is the code of the function.
Is there a way this size restriction to be avoided/expanded?

Thanks in advance for your help!

=====================================

Option Compare Database

'------------------------------------------------------------
Function Macro4()
On Error GoTo Macro4_Err

DoCmd.TransferSpreadsheet acExport, 10, "qry_Name_to_export", "C:\Temp\qry_Name_to_export", True, ""

Macro4_Exit:
Exit Function

Macro4_Err:
MsgBox Error$
Resume Macro4_Exit

End Function

====================

Best rregards
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
correct...you can only use legal file names. There's no need to use crazy characters.
 
Upvote 0
I am not sure your comment is relevant.
I dont use crazy characters and if you did not read my first post - the size is the problem.
 
Upvote 0
I believe that you are missing a file extension in the file name. Perhaps an .xlsx or .xls, etc.
 
Upvote 0

Forum statistics

Threads
1,221,848
Messages
6,162,404
Members
451,762
Latest member
Brainsanquine

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top