I am using in the first part of my program
on error go to start
Suppose in my second part I am again using
on error resume next
This second erro
It is nearly always better to avoid errors, rather than handling them. For example:
Set objexcel = CreateObject("excel.Application")
objexcel.Visible = True
'On Error GoTo Openwb '
'wbExists = False '
If Dir("C:\REPORT3.xls") = "" Then
objexcel.Workbooks.Add
Set wbexcel = objexcel.ActiveWorkbook
Set objSht = wbexcel.Worksheets("Sheet1")
Else
Set wbexcel = objexcel.Workbooks.Open("C:\REPORT3.xls")
Set objSht = wbexcel.Worksheets("Sheet1")
End If
objSht.Activate
'wbExists = True '