C
CDM
My company software generates spreadsheet reports that I import into Access.
Before importing, I have to manually format the report by deleting the first
header row and changing the headings in the second row, etc. I would like to
automate this process by doing it with VB from within Access. However, when
selecting the first row I get an error message that says "Select method of
range class failed". What am I doing wrong? Here's my code:
Dim objWkBook as object
Dim objWkSheet as object
Set objWkBook = Getobject("Path\MyFile.xls")
Set objWkSheet = objWkbook.sheets(1)
objWkSheet.Range("A1:AZ1").Select
Thanks for any help you can offer.
Before importing, I have to manually format the report by deleting the first
header row and changing the headings in the second row, etc. I would like to
automate this process by doing it with VB from within Access. However, when
selecting the first row I get an error message that says "Select method of
range class failed". What am I doing wrong? Here's my code:
Dim objWkBook as object
Dim objWkSheet as object
Set objWkBook = Getobject("Path\MyFile.xls")
Set objWkSheet = objWkbook.sheets(1)
objWkSheet.Range("A1:AZ1").Select
Thanks for any help you can offer.