adhoustonj
Member
- Local time
- Today, 16:22
- Joined
- Sep 23, 2022
- Messages
- 192
Hey hey,
Sup AWF. I was wondering if it was possible to modify this example access file to be late binding vs early binding.
I modified the sample file quite a bit to get everything that i need -- but now that I have a good solution in place, I would also like to change this file from early binding to late binding.
My question is - is it even possible? The way functions are called with 'Worksheet' as input, and functions declared as 'worksheet', 'sheet', etc.
I can probably put this in one sub/function to return what I need - but for learning purposes, my question would be is possible to keep the 95% of the code base/procedures/subs the same, and just modify binding syntax, like set xlApp = new excel.application vs set xlapp create.object("excel.application"), etc.
And i have tried! Spent the last half of my day trying to do this and for once, google was not much help. I'm a SQL guru with a minor in VBA, but everyone just calls me the DB guru because I am the only one at my org with >2000 access db's.
What I am trying to achieve:
I could roll out what I have, but i don't want to give them a version with early binding where IT wakes up in the middle of the bed instead of the left/right side, and rolls out an update that makes the excel library reference incompatible for whatever reason.
I'm battling the mixed column datatype as well, but I think I am over that speedbump with docmd.transferspreadsheet HEADERS = no, and parsing from there.
Sup AWF. I was wondering if it was possible to modify this example access file to be late binding vs early binding.
I modified the sample file quite a bit to get everything that i need -- but now that I have a good solution in place, I would also like to change this file from early binding to late binding.
My question is - is it even possible? The way functions are called with 'Worksheet' as input, and functions declared as 'worksheet', 'sheet', etc.
I can probably put this in one sub/function to return what I need - but for learning purposes, my question would be is possible to keep the 95% of the code base/procedures/subs the same, and just modify binding syntax, like set xlApp = new excel.application vs set xlapp create.object("excel.application"), etc.
And i have tried! Spent the last half of my day trying to do this and for once, google was not much help. I'm a SQL guru with a minor in VBA, but everyone just calls me the DB guru because I am the only one at my org with >2000 access db's.
What I am trying to achieve:
- user navigates to and selects a file via file dialog
- user selects sheet out of all available sheets in excel workbook
- once selected, sheet is loaded to temp table
- from temp table - further processing
I could roll out what I have, but i don't want to give them a version with early binding where IT wakes up in the middle of the bed instead of the left/right side, and rolls out an update that makes the excel library reference incompatible for whatever reason.
I'm battling the mixed column datatype as well, but I think I am over that speedbump with docmd.transferspreadsheet HEADERS = no, and parsing from there.
Selecting and Importing Excel File and Sheet for import into Access
This is a tip that has the code for selecting an Excel file and sheet for import into Microsoft Access. This includes the code required to browse for a file, and populate a ListBox with the sheets of the Excel Workbook, and the code to import an Excel spreadsheet.
www.codeproject.com