I have a line of code similar to this
that works fine IF the Range name in Excel is defined as a predetermined number of cells.
For example, if "OldScheduleFixed" is a named range defined as ("A1:K100"), then no problems. It imports 100 rows of data into my table "OldSched"
However, if I try to use a Dynamic Range Name definition in Excel for the Range to import from such as:
the transfersheet method fails, claiming it cannot find the Range Name.
I was jsut trying to limit the range in Excel from which data would be pulled, as opposed to importing empty rows to my Access Table.
When I go to use the resulting Table in Access I can limit the data selected through a query, but I was trying to do it on the other end.
Any ideas as to why transferspreadsheet can't use a valid Range Name if it's defined with a formula?
Code:
DoCmd.TransferSpreadsheet acImport, 8, _
"OldSched", strFileName, True, "OldScheduleFixed"
that works fine IF the Range name in Excel is defined as a predetermined number of cells.
For example, if "OldScheduleFixed" is a named range defined as ("A1:K100"), then no problems. It imports 100 rows of data into my table "OldSched"
However, if I try to use a Dynamic Range Name definition in Excel for the Range to import from such as:
Code:
=OFFSET(mysheet!$A$1,0,0,COUNTIF(mysheet!$b$1:$b$100,">0")+1,11)
the transfersheet method fails, claiming it cannot find the Range Name.
I was jsut trying to limit the range in Excel from which data would be pulled, as opposed to importing empty rows to my Access Table.
When I go to use the resulting Table in Access I can limit the data selected through a query, but I was trying to do it on the other end.
Any ideas as to why transferspreadsheet can't use a valid Range Name if it's defined with a formula?