deejay_totoro
Registered User.
- Local time
- Today, 12:51
- Joined
- May 29, 2003
- Messages
- 169
Hello,
I am trying to automate the formatting of an Excel spreadsheet from Access, using VBA.
I have managed to do most of what I would like to do by first creating a Macro in Excel then using the macro code as a basis for the VBA code in Access.
But I have run into trouble to trying to execute the Autofill Destination command. These are the two different lines I have used:
Dim excel_app As Object
Dim excel_sheet As Object
...
excel_app.ActiveSheet.Range("I2").AutoFill Destination:=excel_app.ActiveSheet.Range("I2:I" & excel_app.ActiveSheet.Range("A65536").End(xlUp).Row)
excel_app.selection.AutoFill Destination:=Range("I2:I25403")
However both produce the following error:
Run-time error '1004':
Application-defined or object-defined error
Any help or guidance would be most welcome!
Cheers,
dj_T
I am trying to automate the formatting of an Excel spreadsheet from Access, using VBA.
I have managed to do most of what I would like to do by first creating a Macro in Excel then using the macro code as a basis for the VBA code in Access.
But I have run into trouble to trying to execute the Autofill Destination command. These are the two different lines I have used:
Dim excel_app As Object
Dim excel_sheet As Object
...
excel_app.ActiveSheet.Range("I2").AutoFill Destination:=excel_app.ActiveSheet.Range("I2:I" & excel_app.ActiveSheet.Range("A65536").End(xlUp).Row)
excel_app.selection.AutoFill Destination:=Range("I2:I25403")
However both produce the following error:
Run-time error '1004':
Application-defined or object-defined error
Any help or guidance would be most welcome!
Cheers,
dj_T