B
bg18461
This is a snippet from a function I developed, when I run the code i
halts on the 'starred' line below. I think that it has something to d
with the way the filenames are referenced and its not seeing th
filename when it looks for it. Is there any other way I can write thi
code to avoid the subscript errors.
Dim wb1 As Workbook
Dim WBorigName As String
Dim WBname As String
Dim WBname2 As String
Application.ScreenUpdating = False
Var2 = Range("B2").Value
Dim strdate As String
strdate = Format(Now, "mm-dd-yy_h-mm-ss")
WBorigName = "OEF-" & Var2 & ".xls"
WBname = "S:\DPLN\Relrpts\IRSHistory\OEF2006\Entered OEF\" & "OEF-"
Var2 & "_" & strdate & ".xls"
WBname2 = "S:\DPLN\Relrpts\IRSHistory\OEF2006\" & "OEF-" & Var2
".xls"
***Workbooks(WBorigName).SaveCopyAs WBname
Workbooks(WBorigName).Close SaveChanges:=False
Kill (WBname2)
Application.ScreenUpdating = True
End I
halts on the 'starred' line below. I think that it has something to d
with the way the filenames are referenced and its not seeing th
filename when it looks for it. Is there any other way I can write thi
code to avoid the subscript errors.
Dim wb1 As Workbook
Dim WBorigName As String
Dim WBname As String
Dim WBname2 As String
Application.ScreenUpdating = False
Var2 = Range("B2").Value
Dim strdate As String
strdate = Format(Now, "mm-dd-yy_h-mm-ss")
WBorigName = "OEF-" & Var2 & ".xls"
WBname = "S:\DPLN\Relrpts\IRSHistory\OEF2006\Entered OEF\" & "OEF-"
Var2 & "_" & strdate & ".xls"
WBname2 = "S:\DPLN\Relrpts\IRSHistory\OEF2006\" & "OEF-" & Var2
".xls"
***Workbooks(WBorigName).SaveCopyAs WBname
Workbooks(WBorigName).Close SaveChanges:=False
Kill (WBname2)
Application.ScreenUpdating = True
End I