Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA; Ignoring On Error commands

Status
Not open for further replies.

cchristi

Programmer
Sep 29, 2003
14
US
I have 2 two year old Excel and Access applications, and a new Access application, which suddenly have started ignoring the On Error Resume Next & On Error GoTo commands. Within the last 2 months we have upgraded to Access 2002, and within the last month we have been applying the security patches. I had Access reinstalled on Monday. Otherwise, I use DAO.recordsets and have the following references checked.

Visual Basic for Applications
Microsoft Access 10.0 Object Library
Microsoft DAO 3.6 Object Library
OLE Automation
Microsoft ActiveX Data Object 2.5
Microsoft Office XP Web
Microsoft Excel 10.0 Object Library

The error msg is: Object variable or With block variable not set

Help! I am dead in the water until I figure out why it is misbehaving. Thank you in advance. [PC2]


 
Thanks Ken,

The following is from my Excel code:

bCloseX = MsgBox("Close Xdisk File", vbYesNoCancel, "CLOSE COMPANY XDISK FILE")

Select Case bCloseX
Case vbYes
Windows(FileNbr).Activate
ActiveWorkbook.Close (False)
On Error Resume Next
If Windows(NAICWkbk).Activate = True Then
Windows(NAICWkbk).Close (False)
End If
If Windows(Format(LookUpValue, "00000") & "ReptQEx.xls").Activate = True Then
Windows(Format(LookUpValue, "00000") & "ReptQEx.xls").Close False
End If
On Error GoTo 0

I use the resume next command several times. This line has been working for 2 yrs. I even changed it to 'on error goto errorhandler' and in the errorhandler I put 'resume next' Same problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top