LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Difficulty in SaveAs an Addin


Hi all,

I have a workbook contains VBA code for work purpose and distribute it
to my collegues. I want to add code to either enable user to click a
button or even triggered by Workbook_Open event to save it as an Excel
addin and install it thereafter.

But I keep getting error message when I used different alternatives.

METHOD 1: AS FOLLOWING SIMPLE METHOD

Code:
--------------------

AddIns.Add(ThisWorkbook.FullName).Installed = True
--------------------


Excel returns Error 1004: Unable to copy add-in to liabrary. I guess
this is because our personal Addins folders are *hidden * and the Add
method can't access it.

METHOD 2: USING SAVEAS METHOD


Code:
--------------------
ThisWorkbook.SaveAs FileName:=fldr.Path & "\myAddin.xla" _
, FileFormat:=xlAddIn
AddIns("myAddin").Installed = True
--------------------

Note: fldr is a variable containing full path of the Addins folder.

This method yields Error 9: subscript out of range. When I manually
selete the addin file the code copied to liabrary folder
(Add-Ins...\Browse...), Excel said the file is not a valid add-in.

Any help on this annoying issue will be appreciated.

Thanks

Huyeote


--
Huyeote
------------------------------------------------------------------------
Huyeote's Profile: http://www.excelforum.com/member.php...o&userid=13894
View this thread: http://www.excelforum.com/showthread...hreadid=472498

 
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
Difficulty in transposing Richard J New Users to Excel 12 August 6th 06 09:53 AM
difficulty with permutations, please help! Loane Sharp[_2_] Excel Programming 2 August 9th 05 05:32 PM
saveas addin from VBA Dave Ring Excel Programming 3 July 18th 04 12:45 PM
Remove Excel AddIn from AddIn List !! Help carl Excel Programming 2 December 8th 03 03:36 PM
Difficulty with code Tom Ogilvy Excel Programming 3 August 29th 03 04:09 AM


All times are GMT +1. The time now is 08:27 AM.

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

About Us

"It's about Microsoft Excel"