Results 1 to 3 of 3

Thread: How to determine if Excel is runing

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    11

    How to determine if Excel is runing

    I usually create an excel application from VB as follows:

    Private myXLBook As Object

    Set myXLBook = CreateObject("excel.application")
    myXLBook.Visible = True
    myXLBook.Workbooks.Add

    However, instead of this I want to check if excel is already running and if it is I want to create a workbook instead of another excel application. How do you do this?

    Thanks in advance

  2. #2
    jim mcnamara
    Guest
    Try GetObject instead of CreateObject - GetObject checks to see if the object is instantiated. If it is, it uses the existing object.

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Posts
    11
    Excellent Jim thanks a lot !
    That works even if excel is not runing !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width