#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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


--
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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
addin workbook afdmello Excel Discussion (Misc queries) 4 November 15th 05 04:57 PM
AddIn not working right dbjk Excel Discussion (Misc queries) 2 August 12th 05 07:31 AM
What is an addin (in Excel) and how can we create one? shajueasow Excel Discussion (Misc queries) 1 July 17th 05 04:08 AM
How do I stop Excel 2000 from saving file history from file that . Cathy Excel Discussion (Misc queries) 0 March 29th 05 03:27 PM
Backup in Saving a file in Excel 2002 4rs Excel Discussion (Misc queries) 1 January 14th 05 05:09 AM


All times are GMT +1. The time now is 06:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"