+ Reply to Thread
Results 1 to 3 of 3

Personal Macro Workbook interference with other workbook macro(s)

Hybrid View

Xanlithe Personal Macro Workbook... 10-10-2015, 01:43 AM
mehmetcik Re: Personal Macro Workbook... 10-10-2015, 04:20 AM
Xanlithe Re: Personal Macro Workbook... 10-10-2015, 09:41 AM
  1. #1
    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
    On Error resume next
    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
    On Error goto 0
    This Tells excel where to go if there is an error
    
    On error goto ErrorSkip
    Sheets("Sheet1").activate
    Goto Skip
    
    ErrorSkip:
    'If you are here the Sheet1 does not exist so create it
    
    Skip: 
    ' Ok at this point Sheet1 must exist
    'So enable default error handling
    
    On Error Goto 0

    You could set a Global Variable

    Dim ChangeFlag as Boolean
    then check if the flag is set before running a macro

    this will mean you control which macros are run


    Public ChangeFlag as Boolean
    sub Macro1()
    
    If ChangeFlag = True then exit sub
    ChangeFlag = True
    
    'Run Macro2
    Macro2
    ChangeFlag = false
    End sub
    
    
    Sub Macro2()
    If ChangeFlag = True then exit sub
    
    'This will never run
    
    
    End sub
    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.

  2. #2
    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. 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