+ Reply to Thread
Results 1 to 3 of 3

Personal Macro Workbook interference with other workbook macro(s)

  1. #1
    Registered User
    Join Date
    10-10-2015
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2010
    Posts
    9

    Personal Macro Workbook interference with other workbook macro(s)

    I've just started using a Personal Macro Workbook(PMW). I have to because I can't put macros in shared network workbooks (of course!).

    I have 3 extremely simple macros in my PMW. I'm talking REALLY simple. I don't see how they could interfere with anything else. Here's an example of one:

    Sub CommentLate()
    '
    ' CommentLate Macro
    ' Inserts Comment in active cell "Late, called at <time>."
    '
    ' Keyboard Shortcut: Ctrl+Shift+C
    '
    ActiveCell.AddComment
    ActiveCell.Comment.Visible = False
    ActiveCell.Comment.Text Text:="Jay:" & Chr(10) & "Late, called at " & Format(Now(), "h:mm am/pm") & "."
    ActiveCell.Select

    End Sub

    It works perfectly (yeah, I know, no declaration of variables). The other two are equally simple.

    However, after I created the PMW, I discovered that I could no longer run a specific macro (M1) from an established shared workbook file that I must use. It previously worked before I introduced the PMW. There is no error message; it just doesn't produce an output. If I close the PMW, it works again. Note that at least one other macro in the shared workbook works just fine, so it's not universal interference/corruption.

    The really, really weird thing is this: While the PMW and this file are open, I tried the following experiment (trying to duplicate partially the function of M1). This experiment was in a new workbook entirely.

    In cells A1 to A4 I put the numbers 1 to 4. In cells B1 to B4 I put ";". In C1 I put "A1&B1". It produced the expected result: "1;". However, when I copied C1 to C2-C4, the results were all "1;" for all four cells. When I checked the formulas that were copied, they appeared as expected: "A2&B2", "A3&B3", "A4&B4". But the results were still showing all "1;".

    This behaviour disappears when I close the PMW and I get the expected results: 1; 2; 3; 4;. And it reappears when I reopen the PMW.

    Any ideas? Not really expecting any solutions, but hey, I thought I would ask...

    Xan
    Last edited by Xanlithe; 10-10-2015 at 01:51 AM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Personal Macro Workbook interference with other workbook macro(s)

    Have you declared any global variables? If so they may have values when the macro first runs.

    Have you disabled events

    Have you set manual calculation

    Do you use "on error" to handle your errors?

    'This code will ignore any errors
    Please Login or Register  to view this content.
    So use this to select sheet1 for example
    Check to see if the active sheet name is Sheet1
    If not create Sheet1
    But you must undo the error option as soon as possible
    Please Login or Register  to view this content.
    This Tells excel where to go if there is an error
    Please Login or Register  to view this content.

    You could set a Global Variable

    Please Login or Register  to view this content.
    then check if the flag is set before running a macro

    this will mean you control which macros are run


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 10-10-2015 at 09:58 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    10-10-2015
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Personal Macro Workbook interference with other workbook macro(s)

    Thanks. I will try this out when I'm back at work. My work environment doesn't allow me access to the internet.

+ 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: 1
    Last Post: 10-10-2015, 01:00 AM
  2. [SOLVED] Error message when trying to record a macro - No Personal Macro Workbook
    By KimC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2014, 06:56 PM
  3. Replies: 2
    Last Post: 08-13-2014, 06:39 PM
  4. Replies: 1
    Last Post: 08-13-2014, 05:46 PM
  5. [SOLVED] Copying Macro Code into the Personal Macro Workbook
    By tullybcfc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2013, 07:59 AM
  6. Running workbook macro from personal workbook
    By mashley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-10-2009, 08:44 AM
  7. [SOLVED] Macro runs in source , but not when in Personal Macro Workbook
    By Darin Kramer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2005, 12:05 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