O
Opal
I am trying to run the following from Access 2003:
Sub CopyPaste()
Dim lngColumn As Long
Dim xl As Object
Dim wb1 As Object
Dim wb2 As Object
Set xl = CreateObject("Excel.Application")
Set wb1 = xl.Workbooks("North Shop - Empl.xls")
Set wb2 = xl.Workbooks("temp.xls")
wb1.Range("A1:F471").Copy
wb2.Range("A1").Paste
End Sub
I am trying to perform a copy / paste between two excel
workbooks from my access database. I get a
"Subscript out of range" error and debugging points to:
Set wb1 = xl.Workbooks("North Shop - Empl.xls")
Can anyone help me get this working? Thank you.
Sub CopyPaste()
Dim lngColumn As Long
Dim xl As Object
Dim wb1 As Object
Dim wb2 As Object
Set xl = CreateObject("Excel.Application")
Set wb1 = xl.Workbooks("North Shop - Empl.xls")
Set wb2 = xl.Workbooks("temp.xls")
wb1.Range("A1:F471").Copy
wb2.Range("A1").Paste
End Sub
I am trying to perform a copy / paste between two excel
workbooks from my access database. I get a
"Subscript out of range" error and debugging points to:
Set wb1 = xl.Workbooks("North Shop - Empl.xls")
Can anyone help me get this working? Thank you.