Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Save & Install AddIn with VBA

I'm trying to write code to save an activeworkbook as an
addin and then install the addin just saved. Can anyone
help me with this?

Thanks,
Matt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Save & Install AddIn with VBA

Something like


Sub SaveAddIn()
Dim MyName As String, Shortname As String, MyPAth As
String
Dim MyAddIn as String, xlAddIn as AddIn
Application.DisplayAlerts = False
With ThisWorkbook
MyName=.Name
Shortname=replace(MyName,".xls","")
MyAddin=Shortname & ".xla"
'Save as Add in
MyPAth = .Path & "\"
.IsAddin = True
.SaveAs Filename:=MyPAth & MyAddIn,
FileFormat:=xlAddIn
'Save as Workbook again otherwise you won't be able to
see the sheets
.IsAddin = False
.SaveAs MyPAth & Shortname & ".xls",
addtoMRU:=True
End With



On Error resume next
'De Install it
Application.Addins(MyaddIn).Installed=false
'Re Install it
Set xlAddIn=Application.Addins.Add (Mypath &
MyAddIn,true)
xlAddIn.Installed=true
On error goto 0
Application.DisplayAlerts = True
End Sub


-----Original Message-----
I'm trying to write code to save an activeworkbook as an
addin and then install the addin just saved. Can anyone
help me with this?

Thanks,
Matt
.

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
After Excel 2007 install, cannot save files on network share cbass Excel Discussion (Misc queries) 0 June 15th 07 09:57 PM
Install Addin in Excel Jos Vens Excel Programming 0 July 8th 04 11:18 PM
Excel Save pops up when unloading Addin file KimberlyC Excel Programming 0 June 9th 04 08:47 PM
save file as addin programatically Bura Tino Excel Programming 1 May 10th 04 06:07 PM
Cannot install Excel 2002 Analysis Addin Toolpak robbyn Excel Programming 2 January 30th 04 11:41 PM


All times are GMT +1. The time now is 07:10 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"