N
Nick
I'm attempting to copy Excel worksheet 1 in workbook 1 to a worksheet 2
in workbook 2 on click of a button in Access 97 using VBA. I believe I
have the jist of the code worked out, but I'm getting a "Run time error
'438' - Object doesn't support this property or method" error when I
try to test it. here is the code I'm running:
I have the following checked in my References (in this order):
Visual Basic for Applications
Microsoft Access 8.0 Object Library
Microsoft DAO 3.51 Object Library
Microsoft Excel 11.0 Object Library
Any thoughts on how to get past this error?
Thanks,
Nick
in workbook 2 on click of a button in Access 97 using VBA. I believe I
have the jist of the code worked out, but I'm getting a "Run time error
'438' - Object doesn't support this property or method" error when I
try to test it. here is the code I'm running:
Code:
Dim App As Excel.Application
Dim WB1 As Workbook
Dim WS1 As Worksheet
Dim WB2 As Workbook
Dim WS2 As Worksheet
Dim strSB As String
Dim strDB As String
Dim strSS As String
Dim strDS As String
Dim RS As Excel.Range
Dim RD As Excel.Range
strSB = "C:\Deposits.xls"
strDB = "C:\Deposit_Template.xls"
strSS = "depwkst"
strDS = "deposits"
Set App = CreateObject("Excel.Application")
Set WB1 = App.Open(strSB) 'THIS IS WHERE I GET
THE ERROR
Set WB2 = App.Open(strDB)
RS = WB1.Worksheets(strSS).Range("A6:R2532")
RD = WB2.Worksheets(strDS).Range("A2")
RS.Copy RD
I have the following checked in my References (in this order):
Visual Basic for Applications
Microsoft Access 8.0 Object Library
Microsoft DAO 3.51 Object Library
Microsoft Excel 11.0 Object Library
Any thoughts on how to get past this error?
Thanks,
Nick