+ Reply to Thread
Results 1 to 2 of 2

Opening Excel & Addin

  1. #1
    Geoff
    Guest

    Opening Excel & Addin

    I have an Excel addin that if Excel is not open I just want to open the
    addin and Excel at the same time. Is there a way to do this through VB or
    VBA? This would be similar to say double clicking on the XLA through
    explorer.

    Thanks in advance




  2. #2
    Bob Phillips
    Guest

    Re: Opening Excel & Addin

    Sub OpenAddin()
    Dim oXL As Object
    Dim oAI As Object

    On Error Resume Next
    Set oXL = GetObject(, "Excel.Application")
    If oXL Is Nothing Then
    Set oXL = CreateObject("Excel.Application")
    If Not oXL Is Nothing Then
    Set oAI = oXL.Workbooks.Open(Filename:="C:\myTest\m yAddin.xla")
    If oAI Is Nothing Then
    MsgBox "Failed to open add-in"
    End If
    Else
    MsgBox "failed to start Excel"
    End If
    End If
    On Error GoTo 0

    End Sub


    --
    HTH

    Bob Phillips

    "Geoff" <gh@bob.com> wrote in message
    news:eHzMBpdZFHA.2664@TK2MSFTNGP15.phx.gbl...
    > I have an Excel addin that if Excel is not open I just want to open the
    > addin and Excel at the same time. Is there a way to do this through VB or
    > VBA? This would be similar to say double clicking on the XLA through
    > explorer.
    >
    > Thanks in advance
    >
    >
    >




+ 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