+ Reply to Thread
Results 1 to 6 of 6

Stop Workbook_Open macro from running

  1. #1
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Stop Workbook_Open macro from running

    Hello everybody,

    I have a workbook_open event that automatically refreshes two data tables when the user opens the Excel document. The data it refreshes is fed into several graphs. The graphs are then linked to PowerPoint.

    The problem I am encountering is that when I open the PowerPoint document to update the graphs, it automatically runs the Excel macro as well. I have six graphs, so it definitely increases the updating time when I have to wait for it to refresh the two tables six times each.

    Does anybody know the code I can add to the beginning of the workbook_open event to prevent the rest of the code from running if the Excel document is opened through PowerPoint?

    Thanks!

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Stop Workbook_Open macro from running

    Hold the shift button while opening the document.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Stop Workbook_Open macro from running

    Hi, Solus,

    please explain how to hold the Shift-Button if the workbook is opened via Powerpoint. Iīd expect a hint on Application.EnableEvents = False but I donīt have a clue how Powerpoint should come in there to get that command to go.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Stop Workbook_Open macro from running

    when I open the PowerPoint document to update the graphs, it automatically runs the Excel macro as well
    I assumed it was because of an open event handler which I thought could be disabled by holding Shift while opening.



    e/ I shouldn't say open event, I thought holding shift temporarily disabled events.
    Last edited by Solus Rankin; 09-17-2013 at 05:05 PM.

  5. #5
    Forum Contributor
    Join Date
    03-12-2013
    Location
    Chicago, USA
    MS-Off Ver
    Excel 2007
    Posts
    230

    Re: Stop Workbook_Open macro from running

    Let me rephrase that. When I open the PowerPoint document that contains the graphs that are linked to Excel, it gives me two options: "Update Links" or "Cancel". I usually click "Update Links" and then it will continue to open and close the Excel document until all graphs are updated. It is at this point, when the Excel document opens multiple times, that I would like the macro to not completely run.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Stop Workbook_Open macro from running

    I'd say change your workbook open macro into a button or change the event. Sheet_Activate? Selection_Change?

    I'm not sure what the macro is your spreadsheet is supposed to do.

+ 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. Private sub workbook_open code running workbook_open code from other project
    By marshall_massive in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2013, 06:07 PM
  2. Macro to stop running at last row
    By staples in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2009, 01:52 PM
  3. Workbook_Open macro not running
    By mrice in forum Excel General
    Replies: 3
    Last Post: 10-29-2008, 05:48 AM
  4. Stop Workbook_Open macro
    By munkayboi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-11-2007, 12:36 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