+ Reply to Thread
Results 1 to 3 of 3

Trouble distributing macro in addon

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2008
    Posts
    14

    Unhappy Trouble distributing macro in addon

    Hi,

    I'm trying to distribute a macro I created in an Addon file. The addon works on my computer, but does not work on someone elses computer. Here is what I'm doing:

    1) Open up a brand new workbook
    2) Save the work book and title it
    3) Push Alt+F11 and create a module and paste my code
    4) Create a toolbar with a button for a macro, and attach the macro that I just pasted to it
    5) Go back to visual basic and edit the "ThisWorkbook" code module to have this:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Toolbars("CountBinsToolbar").Visible = False
    End Sub
    Private Sub Workbook_Open()
    Toolbars("CountBinsToolbar").Visible = True
    End Sub
    6) Save the file as an Addin in the addon folder with the same name of the workbook that I initially saved.

    As I said when I run it on my machine it works fine, though initially it gave me trouble when I didn't save the workbook as the same name as the addon. When my friend tries to run it (he saves it in his addon folder also), he gets something like "application defined / object defined 1004 error" right at the get go and the toolbar doesn't even get added. I have a hunch that it might be a problem with the file path for the macro when I attach it for the button which I don't even understand why it attaches a path when the macro is copied into a module which is in the workbook / addon. We're both using excel 2003. Anyone ever experience this problem?

    kiss
    Last edited by royUK; 06-04-2008 at 11:37 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Welcome to the Forum. Please take the time to read the Forum Rules & use Code Tags in future.

    It is much better to add the ToolBar within the code, searvch the Forum for Toolbars, I know I have added examples here.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-04-2008
    Posts
    14
    thanks I added the toolbar in the code instead of manually which fixxed the error I had been mentioning. However now I've come across a new set of problems which I'll describe in a new post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Trouble with personal macro workbook
    By debspecs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-14-2008, 01:41 PM
  2. Having trouble with loops in a macro.
    By caliskier in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2007, 12:09 PM
  3. Macro Trouble on T tests. 1600 test to do.
    By gjmcleod in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-19-2007, 06:20 PM
  4. Trouble closing MS Word document from Excel macro
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2007, 01:00 PM
  5. country finder lookup macro
    By theghost in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2007, 10:41 PM

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