Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 99469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:23:37+00:00 2026-05-11T00:23:37+00:00

I am using in the first part of my program On Error GoTo start

  • 0

I am using in the first part of my program

On Error GoTo start

Suppose in my second part I am again using

On Error Resume Next

This second error trap will not get activated as the first one will still be active. Is there any way to de-activate the first error handler after it has been used?

Set objexcel = CreateObject("excel.Application")                      objexcel.Visible = True                      On Error GoTo Openwb                      wbExists = False                      Set wbexcel = objexcel.Workbooks.Open("C:\REPORT3.xls")                      Set objSht = wbexcel.Worksheets("Sheet1")                      objSht.Activate                      wbExists = True Openwb:                                            On Error GoTo 0                      If Not wbExists Then                      objexcel.Workbooks.Add                      Set wbexcel = objexcel.ActiveWorkbook                      Set objSht = wbexcel.Worksheets("Sheet1")                       End If                                            On Error GoTo 0                                           Set db = DBEngine.opendatabase("C:\book.mdb") Set rs = db.OpenRecordset("records")  Set rs2 = CreateObject("ADODB.Recordset") rs2.ActiveConnection = CurrentProject.Connection   For Each tdf In CurrentDb.TableDefs        If Left(tdf.Name, 4) <> "MSys" Then         rs.MoveFirst         strsql = "SELECT * From [" & tdf.Name & "] WHERE s=15 "          Do While Not rs.EOF             On Error Resume Next                          rs2.Open strsql  

Upon execution of the last statement I want to ignore the error and move on to the next table but error handling does not seem to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:23:37+00:00Added an answer on May 11, 2026 at 12:23 am

    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 ' 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first experience using the Zend Framework. I am attempting to follow
This is my first time using joomla. I don't know if I'm using the
I'm working on a program from my C++ textbook, and this this the first
When I first started using revision control systems like CVS and SVN , I
I'm setting up my first site using the asp authentication provider and using the
First off: I'm using a rather obscure implementation of javascript embedded as a scripting
Using jquery how do I focus the first element (edit field, text area, dropdown
First is there any technique for using Action Script for recording sound from microphone?
Using sed what is an one liner to print the first n characters ?
First off, I am using Windows XP. I have multiple hard drives and it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.