With the four sets of quotes at the end, says unexpected end of statement and highlights those. All the code is identical to what you gave me. What is strange is something changed from unsupported object to this.
rsSheet.FindFirst "SheetPathName = """ &PathToExcelFiles + ExcelFileName """"
Actually now I get a syntax error for some reason. I was just trying to mimic it.
And when should I call the Import Function? From the way the function works in your code, looks like I wouldn't need all that I have in the OnOpen event and just call this module instead?
Unfortunately, no matter how I go about it I get the unsupported object error 3251.
Looking at your code, that findfirst line I'm having trouble with. The field in the table Spreadsheets that contains the filename is Spreadsheet and it only contains the filename no path with it. The path is stored in a different table. So when you say "Spreadsheet = """ &PathToExcelFiles +...
Actually to avoid having to touch anything in the Spreadsheets table on import, I added the Spreadsheet field to my main data table plus added a function to Excel to capture the filename so when I append it stores it in the access data table. With the onopen of my main form is where I have it...
I already have the reference piece set up, did that when I started the project. And I currently am storing the path in one database initially and in the Spreadsheets table I'm storing the file name only.
I may have an error in the process/order of doing this.
What I'd like to do is have the file name of the Excel worksheet/workbook I'm using to capture the name of itself in a cell in a hidden worksheet.
Please advise, thank you!
Not exactly sure what this piece is doing:
cnXcell.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "c:\PayrollRec.xls" & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"
Set rsXcell = cnXcell.OpenSchema(adSchemaTables)
Do While Not rsXcell.EOF
WorksheetName =...
I know how to call/set CurrentDb and open the table I'm working with. Just curious as to how to do the same thing with an Excel worksheet and the associated cell data. Thanks.
To clarify the final piece:
Spreadsheets is an Access table that stores the file names and date modified of any given Excel spreadsheet in my current directory. Fields are Spreadsheet and DateModified.
What I would like is that for the code to run the append query for any given...
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.