+ Reply to Thread
Results 1 to 9 of 9

Personal.XLSB procedure to run in any project

Hybrid View

  1. #1
    Registered User
    Join Date
    04-20-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    26

    Personal.XLSB procedure to run in any project

    Hello Everyone

    I think that I am having trouble with permissions here. I have VBA code that I have stored in my Personal.xlsb. this code though need to be able to run on any workbook that i load up. If i copy the Sub procedure into the Associated Workbook Project i can get it to work, but it will not run when it is just in my Personal.XLSB project. Therefore how can i run a Sub from my personal Project that runs on any project (workbook) that i load up.

    It used to work but i have changed laptop and the above is the problem i am now experiencing.

    can anyone help please

    Thanks
    Jaimie
    Last edited by romperstomper; 11-25-2010 at 11:33 AM. Reason: mark solved

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Personal.XLSB procedure to run in any project

    What is the actual problem you are having? i.e. what specifically do you mean when you say it will not run?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    04-20-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Personal.XLSB procedure to run in any project

    Quote Originally Posted by romperstomper View Post
    What is the actual problem you are having? i.e. what specifically do you mean when you say it will not run?


    Hello - I have attached a workbook that shows the problems i am getting. This used to work fine and works on a friends computer.


    any help please
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Personal.XLSB procedure to run in any project

    The error is because you haven't declared x as a variable.

    Why have the code in a PERSONAL workbook, but aim it at a specific workbook, you may as well have the code in that workbook
    Hope that helps.

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

    Free DataBaseForm example

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Personal.XLSB procedure to run in any project

    Do you have a sub called x in your personal workbook?

  6. #6
    Registered User
    Join Date
    04-20-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Personal.XLSB procedure to run in any project

    That is brilliant Roy, Thank you very - it works now...

    romper - no I didn't declare the variable in the Workbook one and it worked - but doesn't work on the Personal workbook until I declare it.

    I cant remember exactly why I wanted it all under one module on my personal workbook but there was a reason for it ....I think I didn't want anyone else using the Macro, or it increasing the file size. also i can use find and replace to change all the macros at once if they are under the one module instead of implanted into each specific workbook. is this considered bad practise?

    anyways this works not, thanks a lot for your help

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Personal.XLSB procedure to run in any project

    Presumably then you have
    Option Explicit
    at the top of your module in the Personal.xlsb workbook, and you don't in the other workbook.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  8. #8
    Registered User
    Join Date
    04-20-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Personal.XLSB procedure to run in any project

    i would put it as solved but when i look at my original qoute although it says it is me that has posted it, it looks just like everyone else post, no mgr options like edit? i am logged in so dont get it

  9. #9
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,971

    Re: Personal.XLSB procedure to run in any project

    I think too much time has passed. Don't worry, I've done it for you.

+ 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