+ Reply to Thread
Results 1 to 2 of 2

Saving Addin

  1. #1
    Forum Contributor
    Join Date
    04-30-2004
    Posts
    122

    Saving Addin

    I've created a workbook that has several macros which are linked to excel menu items. I am trying to programatically save this workbook as an addin to my xlStart folder. However, the bit of code that I'm using doesn't seem to be working correctly (or at least how I thought it would). What I thought would happen is that this addin would open up in the background. However, everytime I open up Excel, the workbook opens up. Is this because it is saving as an Excel workbook and not an addin? Any ideas?

    Application.DisplayAlerts = False
    fName = "C:\Program Files\Microsoft Office\Office\XLStart\Custom.xla"
    Call ActiveWorkbook.SaveAs(fName, xlAddIn)
    Application.Quit

  2. #2
    Dave Peterson
    Guest

    Re: Saving Addin

    I'd use something like:

    Option Explicit
    Sub testme()
    Dim fName As String
    fName = Application.StartupPath & "\" & "custom.xla"
    With ThisWorkbook
    .IsAddin = True
    Application.DisplayAlerts = False
    .SaveAs Filename:=fName
    Application.DisplayAlerts = True
    End With
    End Sub


    Don't store the .xls in that XLStart folder, either.

    Rutgers_Excels wrote:
    >
    > I've created a workbook that has several macros which are linked to
    > excel menu items. I am trying to programatically save this workbook as
    > an addin to my xlStart folder. However, the bit of code that I'm using
    > doesn't seem to be working correctly (or at least how I thought it
    > would). What I thought would happen is that this addin would open up
    > in the background. However, everytime I open up Excel, the workbook
    > opens up. Is this because it is saving as an Excel workbook and not an
    > addin? Any ideas?
    >
    > Application.DisplayAlerts = False
    > fName = "C:\Program Files\Microsoft
    > Office\Office\XLStart\Custom.xla"
    > Call ActiveWorkbook.SaveAs(fName, xlAddIn)
    > Application.Quit
    >
    > --
    > Rutgers_Excels
    > ------------------------------------------------------------------------
    > Rutgers_Excels's Profile: http://www.excelforum.com/member.php...fo&userid=8973
    > View this thread: http://www.excelforum.com/showthread...hreadid=560065


    --

    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