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 7188431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:04:58+00:00 2026-05-28T19:04:58+00:00

I have a Visual Basic program in Excel which opens Word documents and copies

  • 0

I have a Visual Basic program in Excel which opens Word documents and copies information from Word into Excel. At its heart is a for loop which goes through each table in one document. Inside the for loop is a call to a function to process that table:

For nCurrentTable = 1 To nTotalTable
    ' Process each table in Word document, one at a time.
    Call Process_One_Table(nCurrentTable, nTotalTable, vDocName)
Next nCurrentTable

The n variables are Longs, vDocName is a Variant.

Why is the script exiting that function to go to the next at the end of the for loop? It has happened at various points. Right now it occurs after (code from deep in Process_One_Table):

Cells(1, nColumn).Select
Selection.EntireColumn

It also occurred after I misused an assignment, assigning a String to a Long (which I’ve now corrected).

  • 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. Editorial Team
    Editorial Team
    2026-05-28T19:04:59+00:00Added an answer on May 28, 2026 at 7:04 pm

    An On Error Resume Next in the calling procedure is the most likely cause of this. If the called procedure raises an error, execution resumes at the next line of the calling procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Visual Basic .Net 2.0 program. I'm moving the settings from an
The last GUI programming I have done was with Visual Basic, which included objects
I have written a program in visual basic and want it to display the
I have created a program in Visual Basic using Microsoft Visual Studio 2010 Professional.
I have a very basic Visual Basic Program that I created in Visual Studio
In a Visual Basic 6.0 program, I have a string sTemp that I want
I have written a program on Visual Basic. In the debug folder, there are
I am busy writing a program in Visual Basic .NET and I have a
I have recently used Visual Basic .Net to write a particle system which emits
I have acquired a DLL that was created in Visual Basic from a third

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.