M
M Armaghan Khan
i am having problem in hadling error in for next statement i have make a
program
to convert Excel 2007 sheets in Excel-2003. i have made a array and put all
the
file names in it please see below if some files are missing and programs
wants to
opern it error occurs i have use the on error goto Lasteline to skip to the
next counter it works fine when program doesn't find first file but if
another file is missing the program crashes i don't know why on error goto
lasteline not working on second attempt
Please help
For i=1 to 129
On Error Goto Lastline
Workbooks.Open Filename:="" & aPath & "\" & saleId(a) & "-Deduction.xls"
ActiveWorkbook.SaveAs Filename:= _
"" & bPath & "\" & saleId(a) & "-Deduction-" & newName & ".xls" _
, FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Lastline:
a = a + 1
Next i
End Sub
program
to convert Excel 2007 sheets in Excel-2003. i have made a array and put all
the
file names in it please see below if some files are missing and programs
wants to
opern it error occurs i have use the on error goto Lasteline to skip to the
next counter it works fine when program doesn't find first file but if
another file is missing the program crashes i don't know why on error goto
lasteline not working on second attempt
Please help
For i=1 to 129
On Error Goto Lastline
Workbooks.Open Filename:="" & aPath & "\" & saleId(a) & "-Deduction.xls"
ActiveWorkbook.SaveAs Filename:= _
"" & bPath & "\" & saleId(a) & "-Deduction-" & newName & ".xls" _
, FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Lastline:
a = a + 1
Next i
End Sub