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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:12:27+00:00 2026-05-12T22:12:27+00:00

I have a simple Excel file that queries a database when it opens and

  • 0

I have a simple Excel file that queries a database when it opens and then closes automatically.

  • If I double click the file to open it from within Windows Explorer (I’m running Windows XP and Excel 2002), it works fine.
  • However, if I run it using Excel "C:\DataUpdate.xls" from Start > Run or from Shell within another instance of Excel in a separate file, Excel will crash on exit.

I can’t figure out why it does it one scenario and not in the other.

In DataUpdate.xls, I have 2 procedures, UpdateTable() and OnWorkbookOpen(), which is called from Workbook_Open() when the workbook opens.

Option Explicit

Sub UpdateTable()

Dim ws As Worksheet
Dim qt As QueryTable

Set ws = Worksheets("Sheet1")
Set qt = ws.Range("A1").QueryTable

qt.Refresh BackgroundQuery:=False

End Sub

Sub OnWorkbookOpen()
On Error Resume Next
If ActiveWorkbook.Name = "DataUpdate.xls" Then
'I put this If statement in so I can change the file's
'name and then edit the file without code
'running.

    UpdateTable
    ActiveWorkbook.Save

    Excel.Application.Quit
End If


End Sub

If I open the file from Windows Explorer, everything is fine. If I run it from the command line with Excel "C:\DataUpdate.xls", the code runs fine until the application tries to exit with Application.Quit, at which point Excel throws an exception.

When I view the details of the error report, here’s some of the information I find:

AppName: excel.exe
AppVer: 10.0.6854.0
ModName: olconnector.dll
ModVer: 2.0.2303.0
Offset: 000114d5

Why is there different behavior based on how I start the application and what can I do so that the application behaves the same regardless of how I start it?

  • 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-12T22:12:27+00:00Added an answer on May 12, 2026 at 10:12 pm

    According to google olconnector.dll is outlook connector, an office add-in.

    http://ask.officelive.com/workspace/qna/t/4578.aspx

    Since it is dealing with Outlook, I believe it would have some dependency on the login you are using on the machine.

    When you are opening excel, are you using the same credentials as the account you log in to the computer with?

    ProcessStartInfo startInfo = null;
    Process batchProcess = null;
    
    startInfo = new ProcessStartInfo();
    startInfo.Domain = "somedomain";
    startInfo.UserName = "Domainuser";
    startInfo.Password = "pwd";
    

    Not really sure on what the error is, but this is something you could try out.

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

Sidebar

Ask A Question

Stats

  • Questions 231k
  • Answers 231k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use the following function like this: Image('/path/to/original.image', '1/1', '150*', './thumb.jpg');… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer Check you database schema to see if the field (referenced… May 13, 2026 at 2:13 am
  • Editorial Team
    Editorial Team added an answer I figured out the problem - there was a session… May 13, 2026 at 2:13 am

Related Questions

Not sure if this question is going to make sense or not be here
I have a simple problem that reads an Excel file (using interop) and fills
The question title is probably not correct because part of my question is to
I have a simple report that I want to export to a CSV file.
I have a simple database table called Entries: class CreateEntries < ActiveRecord::Migration def self.up

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.