+ Reply to Thread
Results 1 to 4 of 4

Open Excel using VBA

  1. #1
    Registered User
    Join Date
    08-18-2005
    Posts
    34

    Open Excel using VBA

    Hi all,

    Can somebody please provide me with the VBA code that opens a new Excel Application and not Excel Workbook.

    I.e. I need two instances of Excel running - 1 that contains the code to open the second instance.

    THANKING YOU ALL

  2. #2
    Dave Peterson
    Guest

    Re: Open Excel using VBA

    I'm not sure why you want another instance of excel, but...


    Option Explicit
    Sub testme()
    Dim xlApp As Object
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    End Sub



    moglione1 wrote:
    >
    > Hi all,
    >
    > Can somebody please provide me with the VBA code that opens a new Excel
    > Application and not Excel Workbook.
    >
    > I.e. I need two instances of Excel running - 1 that contains the code
    > to open the second instance.
    >
    > THANKING YOU ALL
    >
    > --
    > moglione1
    > ------------------------------------------------------------------------
    > moglione1's Profile: http://www.excelforum.com/member.php...o&userid=26414
    > View this thread: http://www.excelforum.com/showthread...hreadid=480809


    --

    Dave Peterson

  3. #3
    Registered User
    Join Date
    08-18-2005
    Posts
    34
    Thank you very much for your response but that does not QUITE work.

    Basically it does open the other instance of EXCEL. But then it closes it back down.

    Anyway around this at all. I am new to VBA so dont fully understand it yet.

    Thank you very much

  4. #4
    Dave Peterson
    Guest

    Re: Open Excel using VBA

    What happens if you do something in that instance?

    Option Explicit
    Sub testme()
    Dim xlApp As Object
    Dim xlWkbk As Object
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    Set xlWkbk = xlApp.Workbooks.Add
    End Sub

    If you don't want that empty workbook hanging around:

    Option Explicit
    Sub testme()
    Dim xlApp As Object
    Dim xlWkbk As Object
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    Set xlWkbk = xlApp.Workbooks.Add
    xlWkbk.Close savechanges:=False
    End Sub





    moglione1 wrote:
    >
    > Thank you very much for your response but that does not QUITE work.
    >
    > Basically it does open the other instance of EXCEL. But then it closes
    > it back down.
    >
    > Anyway around this at all. I am new to VBA so dont fully understand it
    > yet.
    >
    > Thank you very much
    >
    > --
    > moglione1
    > ------------------------------------------------------------------------
    > moglione1's Profile: http://www.excelforum.com/member.php...o&userid=26414
    > View this thread: http://www.excelforum.com/showthread...hreadid=480809


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1