+ Reply to Thread
Results 1 to 19 of 19

Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

  1. #1
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    I'm trying to run a macro from my Personal.XLSB set of macros from another macro in there. I modified the code in macro 2 to execute the first macro, adding:

    Application.Run ("'Personal.xlsb!Consecutive_Giving_Analysis'")

    The first macro is named Consecutive_Giving_Analysis

    I always get a 1004 error, saying "The Macro may not be available in this workbook or all macros may be disabled."

    Any ideas here? What should I be doing to execute that macro from within another one?

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Try
    Please Login or Register  to view this content.
    Is the Personal.xlsb file hidden? If so, it may not work.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Quote Originally Posted by gmr4evr1 View Post
    Try
    Please Login or Register  to view this content.
    Is the Personal.xlsb file hidden? If so, it may not work.
    Tom: That gives me the same result:
    2015-06-14_100007.jpg

    The Personal.xlsb folder isn't hidden. I checked the attributes. Any other ideas? Thanks - Joel

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Have you checked under options, trust center, macro settings to see if macros have been enabled there?

  5. #5
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Quote Originally Posted by gmr4evr1 View Post
    Have you checked under options, trust center, macro settings to see if macros have been enabled there?
    Yes:
    2015-06-14_101836.jpg

  6. #6
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Hmmmm.....Not sure where to go from here.

  7. #7
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Does anyone else have any ideas?
    Last edited by js0873; 06-22-2015 at 01:10 PM.

  8. #8
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    One thing I just found out is that I can invoke a different macro in my Personal.XLSB, just not this one. I have no idea what might make this one different, but it's not misspelled.

  9. #9
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Just grasping at straws here, but, I noticed something in the screenshot in post #3. In the error message, at the end of the macro name if shows
    Please Login or Register  to view this content.
    Instead of
    Please Login or Register  to view this content.
    No double quote at the end of the name, it's a single. Not sure if this is an issue, but, cant hurt to check it out.

  10. #10
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    I wish it were that simple. Here's the 2 exact statements, back to back:

    Application.Run "PERSONAL.XLSB!Find_Duplicates.Find_Duplicates"
    Application.Run "PERSONAL.XLSB!Consecutive_Giving_Analysis"

    The first runs fine. The second gives the attached error.

    2015-06-22_130113.jpg

  11. #11
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Hmmm, well, I'm out of ideas again. Will get back to you if something else pops into my head.

  12. #12
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    What happens if you click Debug when the error comes up?

  13. #13
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Quote Originally Posted by gmr4evr1 View Post
    What happens if you click Debug when the error comes up?
    It simply highlights the line in error in the VBA code:

    2015-06-22_134408.jpg

  14. #14
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Grrrr, ok, out of ideas again.

  15. #15
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Are you by chance clicking a button to run the macro? If so, check that it is still assigned. I am helping another member with an issue an noticed that I get the same error message when I click on one of the buttons they have. The problem with theirs is that the macro is no longer assigned to that button.

  16. #16
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Quote Originally Posted by gmr4evr1 View Post
    Are you by chance clicking a button to run the macro? If so, check that it is still assigned. I am helping another member with an issue an noticed that I get the same error message when I click on one of the buttons they have. The problem with theirs is that the macro is no longer assigned to that button.
    No, I'm actually in the VBA code and using F5 to test it out, so I know it's running the actual macro.

  17. #17
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    I figured it wouldn't be something that simple, but had to ask.

  18. #18
    Forum Contributor
    Join Date
    05-13-2010
    Location
    Dallas, TX
    MS-Off Ver
    2019
    Posts
    129

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    OK, I think I finally found the problem. My module name is Consecutive_Giving_Analysis. I generally name the module the same name as the subroutine name within that module.
    To successfully run the subroutine named Consecutive_Giving_Analysis within the module Consecutive_Giving_Analysis, I needed to do this:

    Application.Run "PERSONAL.XLSB!Consecutive_Giving_Analysis.Consecutive_Giving_Analysis"

    I had been doing this:

    Application.Run "PERSONAL.XLSB!Consecutive_Giving_Analysis"

  19. #19
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro

    Dang it! I was going to ask you about that yesterday because I noticed in your sample from post #10 that the other macro had the name in it twice.

+ 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. Replies: 0
    Last Post: 01-15-2015, 05:53 AM
  2. [SOLVED] Personal.xlsb Macro Naming Format
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2014, 04:20 PM
  3. cannot run macro if personal.xlsb is hidden
    By illusionek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2014, 08:16 AM
  4. Run-Time Error 1004 When Running Macro from Another Personal Workbook (xlsb)
    By vcs1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-01-2013, 12:05 PM
  5. DELETE the Personal.XLSB macro I created - can't get rid of it!
    By Cut2please in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2013, 07:51 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