Rather than hardcode the filename into the filename argument of the Transferspreadsheet method, I would like to have the User enter the path. How can this be accomplished?
Dim strFileName As String
strFileName = InputBox("Enter the full path and file name of your excel spreadsheet."
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "tblExcel", strFileName, True
this code creates a variable called strFilename
It asks the user to enter a path and filename and stores the answer in the variable.
the transferspreadsheet method then uses what is stored in strFilename as an argument.
HTH
B ----------------------------------
Ben O'Hara
bo104@westyorkshire.pnn.police.uk
----------------------------------
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.