E
Edgar Thoemmes
I am having problems with the following code.
It comes up with the error Subscript out of range - I know
this can be caused when you are refering to the workbooks
full path instead of the name but I can see this happening
here.
Does anyone have any ideas?
'Get file path for import
ChDrive "S"
ChDir "S:\Kingston\FA\Overseas Payments\Overseas Payments
Public\Ed"
fname = Application.GetOpenFilename()
'Check that a file was selected
If fname <> "" Then
Range("a1").Value = fname
Set oWb = Workbooks.Open(fname)
oWb.Sheets("TEST11").Range("A1:AQ100").Copy
Windows("Remittance Procedure.xls").Activate
Sheets("Crystal_Table").Select
ActiveSheet.Paste
Else
MsgBox ("Please select a Valid File")
End If
oWb.Close
It comes up with the error Subscript out of range - I know
this can be caused when you are refering to the workbooks
full path instead of the name but I can see this happening
here.
Does anyone have any ideas?
'Get file path for import
ChDrive "S"
ChDir "S:\Kingston\FA\Overseas Payments\Overseas Payments
Public\Ed"
fname = Application.GetOpenFilename()
'Check that a file was selected
If fname <> "" Then
Range("a1").Value = fname
Set oWb = Workbooks.Open(fname)
oWb.Sheets("TEST11").Range("A1:AQ100").Copy
Windows("Remittance Procedure.xls").Activate
Sheets("Crystal_Table").Select
ActiveSheet.Paste
Else
MsgBox ("Please select a Valid File")
End If
oWb.Close