Link to home
Start Free TrialLog in
Avatar of JMO9966
JMO9966

asked on

VBA - Excel programming question

Hello,
 
I'm maintaining a project that I didn't originally code.  This code lies in an MSAccess import program that imports data from an Excel spreadsheet.

The spreadsheet was originally laid out without using Named Ranges, but this code appears to do something similar to a named range. Ths spreadsheet has column headers in Row 1 and data starting in Row 2.  The Row 1 value for this column M is "Imperial_Or_Metric".

I can't figure out how the following line knows to gather data and where from??  The real issue is I added named ranges for my additions and I added some data definition info in rows 2-4 and now have import data rows starting in row 5 and my MSAccess import program now dies on this line:


DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Imp_UofM", Me.txtPath, True, "Unit_Of_Measure!A1:B65000"


Can someone interpret this line of code and how I can make it get along with NameRanges or at minimal make it start at row 5 of my spreadsheet for actual import data?

Thank You,
JMO9966
ASKER CERTIFIED SOLUTION
Avatar of JohnBPrice
JohnBPrice

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial