Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Proper methods for getting/managing Excel instances ? (vbscript)

Proper methods for getting/managing Excel instances ? (vbscript)

Proper methods for getting/managing Excel instances ? (vbscript)

Hi All - This is in vbscript and not VBA, but figured the VBA MSFT community might have an answer/explanation of this.
What is the difference between these two methods of getting a currently running Excel process?

Set objExcel = GetObject( , "Excel.Application")
Set objExcel = eval("getobject(,""Excel.Application"")")

Which is the preferred method? Using the second line, I am curious if this leads to some inconsistencies in our scripts (ie .quit still has a 'do you want to save' popup despite calling objExcel.DisplayAlerts = false
Many thanks in advance!

RE: Proper methods for getting/managing Excel instances ? (vbscript)

I can't answer the main question since I'm not sure how Eval would respond (looks like it is running a line of code that you could generate programatically). But reading on I saw that when you're quitting Excel you're occasionally being asked to save when you don't want to be prompted. If you save your workbooks prior to closing or close the workbook and specifically tell Excel not to save any workbook changes then you'll be able to avoid having Excel ask that question.

RE: Proper methods for getting/managing Excel instances ? (vbscript)

Try to repeat .DisplayAlerts before .Quit.
MS changed the functionality of DisplayAlerts property in newer excel versions, it can be restored (set to True) automatically in some cases.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close