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

I've been developing my first iPhone app part-time and would like to start using
20120315021529.000[-8:PST] to get the first part I was able by using below C# code.
I'm using the first answer to this question Overcoming Python's limitations regarding instance methods
I'm working on a program from my C++ textbook, and this this the first
I'm writing a program for a 8051 microcontroller. In the first part of the
Here is part of a class definition in an iOS program using reference counting
I was originally using SQLCE first starting with LINQ to SQL and then moved
I've been using Database First, EF 4.1 I am getting The entity type List`1
I'm trying to learn EF using code first, i dont know how to design
When defining a string in a class using Code First, the default for the

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.