+ Reply to Thread
Results 1 to 7 of 7

Workbook_Open() not working anymore

  1. #1
    Registered User
    Join Date
    07-06-2022
    Location
    Helsinki, Finland
    MS-Off Ver
    O365
    Posts
    5

    Workbook_Open() not working anymore

    Please Login or Register  to view this content.
    is not working anymore. I removed a class module from PERSONAL.XLSB which had only one line:
    Please Login or Register  to view this content.
    ..and then some commented code. This was related to an old macro which was not in use. Reverting this makes no change.

    I have confirmed that:
    1. I have macros enabled
    2. Exact phrase to call Workbook_Open is:
    Please Login or Register  to view this content.
    4. Workbook_Open() is called in ThisWorkbook object
    5. Events are enabled, I ran:
    Please Login or Register  to view this content.
    in VBA Immediate window. Then
    Please Login or Register  to view this content.
    and got result:
    Please Login or Register  to view this content.
    Other macros run normally as before, Workbook_Open() just does not fire up on opening workbooks anymore.

    Now I have done all of this:
    - Used Windows Apps & Features 'Repair' function for Office
    - Digitally signed the macros in workbook
    - Tested Excel's every setting for Macro security
    - Tested with a new workbook, both .xlsx and .xlsb
    - Tested different settings of Protected View
    - Added OneDrive and a network folder as Trusted locations
    - Opened workbook from local hdd, not network or OneDrive?
    - Ran Excel as administrator
    - Tried a 2 week old backup of PERSONAL.XLSB
    - Removed all add-ins, DAX-studio stays
    - Uninstalled DAX-studio
    - Used Windows Apps & Features 'Reset' function for Office
    - Unistalled Office
    - Reinstalled Office - My ribbon customization remained as well as recent and pinned workboos. Apparently uninstall does not remove every bit of Office.

    When I start Excel, from shortcut, WorkbookOpen() is triggered. Meaning, when PERSONAL.XLSB is opened the macro runs. But it's not running when I open a Workbook, by any method, double-clicking in explorer or File → Open from Excel itself.

    Starting to be a bit desperate here. Thought reinstall at least woud have fixed this but no. Anyone any ideas?

    Crossposted here: https://www.mrexcel.com/board/thread...kbook.1212578/
    Last edited by Glenn Kennedy; 08-18-2022 at 10:11 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,435

    Re: Workbook_Open() not working anymore

    Welcome (back) to the forum.

    Thanks for your question. However, we have just found out that you have posted the same question elsewhere.... and haven't told us. Feel free to cross-post on other sites...

    But. Every forum has its rules. Please see Forum Rule #3 about cross-posting. So.

    Do not keep it a secret. We all are willing to give you our time, freely. However, some of us get very annoyed if we waste our time developing a solution for you, when you already have a nice solution elsewhere. All we ask is that you show us some respect and tell us:

    1) if you have cross-posted, and

    2) the URL of the cross posts.

    That way, those of us who don't want to waste their time can quickly check to see if you're already happy with another solution.

    (Note:since you are new here, on THIS occasion, I have done it for you).
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    07-06-2022
    Location
    Helsinki, Finland
    MS-Off Ver
    O365
    Posts
    5

    Re: Workbook_Open() not working anymore

    Ok, thanks for your your response. I'm good at following rules but bad at knowing them. Added few more crosspost links. Thanks for the first one.

    Actually I'm not allowed to post links yet: "You are not allowed to post any kinds of links, images or videos until you post a few times.
    "
    Last edited by JasonNH; 08-18-2022 at 10:25 AM.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,681

    Re: Workbook_Open() not working anymore

    Just to make sure: Is your Workbook_Open code in special module: Thisworkbook (it could have different names - in Polish it is TenSkoroszyt - meaning exactly "this workbook" so may be in your case it is also called a bit different.
    Attached Images Attached Images
    Best Regards,

    Kaper

  5. #5
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,260

    Re: Workbook_Open() not working anymore

    Try building the Personal file from scratch.

    1. If the current Pesonal file contains valuable macros, then export all relevant modules to a safe place (in the VBA editor, select each module one by one and use the shortcut Ctrl+E). If the file does not contain important macros, then ignore this step.
    2. Close Excel (a necessary condition).
    3. Locate the Personal file on the disk. The most common location is: C:\Users\<user_name>\AppData\Roaming\Microsoft\Excel\XLSTART\.
    4. Move the file to another folder, such as D:\Backup\.
    5. Open Excel, start recording the macro and stop immediately. A new Personal.xlsb will be created.
    6. Insert the Workbook_Open procedure into the ThisWorkbook module and save the file (shortcut Ctrl+S when you are in the VBA editor).
    7. Close Excel and open it again to check if the procedure works.
    8. If needed, import previously archived modules with macros.

    There are times when the Personal file gets corrupted. Above I described how to restore this file to get rid of possible file errors.


    Artik

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,435

    Re: Workbook_Open() not working anymore

    Quote Originally Posted by JasonNH View Post
    Ok, thanks for your your response. I'm good at following rules but bad at knowing them. Added few more crosspost links. Thanks for the first one.

    Actually I'm not allowed to post links yet: "You are not allowed to post any kinds of links, images or videos until you post a few times.
    "
    Put ONE extraneous space in them... e.g. ht tp and I can remove it and they'll be live links.

  7. #7
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,260

    Re: Workbook_Open() not working anymore

    JasonNH, once again I'm reading this thread and I'm wondering what result of the code you expect.
    The Workbook_Open event software in the Personal file only causes the code for this event to run once when you open the Excel application. It doesn't matter whether you open the application itself (e.g. from a shortcut) or open the workbook file (by double-clicking in the file manager) when Excel was closed. Since Excel was previously closed, issuing one of the commands (run Excel or open file) causes the application to open and load the Personal file - at this point the Workbook_Open event in the Personal file is raised. Once Excel is running, further file opening no longer triggered the Workbook_Open event in the Personal file. And I suspect that if you open more files, you expect the Open event in Personal to be triggered again.

    Please describe in detail what you want to achieve through the Workbook_Open event in the Personal file.

    Artik

+ 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. [SOLVED] FTPPutFileA not working anymore?
    By Andrew Entee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2022, 01:04 PM
  2. [SOLVED] excel-2016 workbook_open event doesn't trigger anymore
    By Keebellah in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2021, 04:01 AM
  3. F1 Help key not working anymore
    By Phil8 in forum Excel General
    Replies: 0
    Last Post: 09-16-2017, 10:13 AM
  4. [SOLVED] CSV to XLSX Not Working Anymore
    By kas.samrari in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-24-2016, 07:41 PM
  5. VBA Macro not working anymore
    By winsomeness in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-09-2015, 08:20 PM
  6. VBA code not working anymore
    By random379 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2012, 03:01 AM
  7. [SOLVED] Filter is not working anymore.
    By Berry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2006, 02:45 AM

Tags for this Thread

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