Import Sheet Error

zezo2021

Member
Local time
Today, 15:48
Joined
Mar 25, 2021
Messages
415
Hello friends

when trying to import a sheet from an excel file I face this problem

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "TempDetails", txtFolderPath.Value & "\" & cboFileName.Value, False, cboSheets.Value & "$"

Sample of Sheet name Include dot
2.4_OTLDetails


This is not a valid name. Make sure it is a valid parameter or alias name, that it does not include invalid characters or punctuation, and that the name is not too long. (Error 3125) | Microsoft Docs


What should I do
 
Last edited:
the dot makes the name invalid, don't know if it will work but try surrounding with square brackets

"[" & cboSheets & "$]"

note .value is not required as that is the default property
 
You could try:
1- rename the file to remove the "."
2- post all related code
 

Users who are viewing this thread

Back
Top Bottom