+ Reply to Thread
Results 1 to 21 of 21

On open event

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    On open event

    I have the following code to open a form when the workbook opens.

    Please Login or Register  to view this content.
    It worked great until yesterday on a Surface Pro and it works on my desktop. Yesterday the Surface Pro did an update. What would have changed to make this not work? When opened the User form does not open.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: On open event

    What happens during all the updates is one of life's big mysteries.
    Your problem may be nothing to do with the update (a coincidence)

    Please create a new workbook on the Surface Pro
    - add the above workbook_open event macro
    - create a simple userform with same name

    Save the file
    Close it
    Open it

    Does it work?
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: On open event

    kev_

    Thanks for the reply. It does not.

    I tried a simple
    Please Login or Register  to view this content.
    in the on open event and it works sometimes, although right now I can not get it to work.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: On open event

    Hey PDL,

    You might need to fully qualify your "Worksheets("Building")" as having more than one workbook open at a time, Excel wouldn't know which workbook you were using to look for that "Building" sheet. Something like debug.print ActiveWorkbook.Name might show you the problem.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: On open event

    Has Excel on Surface Pro lost its ability to trigger events possibly?

    Here's a quick test:
    Put code below in a SHEET module and select a cell in that sheet
    Does the message pop up?

    Please Login or Register  to view this content.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: On open event

    @kev - I also wonder if upgrades to OneDrive and the way files are stored makes a difference. If the OP opened the file from OneDrive and had a copy on his hard drive, what is Excel supposed to do? Collaboration is a big deal now with upgrades in Microsoft land. Perhaps the file is already open by a colleague and OnOpen is confused??

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: On open event

    @MarvinP
    Yes - life used to be much simpler when we all sat up our own little tree
    Children playing with the same toy often leads to tears - file sharing is similar...

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: On open event

    I still think the OP's code is looking at the wrong workbook as s/he has many opened at the same time. I make that "Fully Qualified" mistake in my code too often.

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: On open event

    @MarvinP I hope you are correct - it's the simplest answer to the puzzle

  10. #10
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: On open event

    So, the Message Box "Hello" test works.

    I have taken the If statement out and just have
    Please Login or Register  to view this content.
    In the On Open event.

    If I restart the Surface the first time I open the Workbook it works properly and opens the User Form. I close the Workbook and then every time I open after that the User Form does not open.

    No other version in OneDrive or Dropbox. Not on any other computer.

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: On open event

    Open your task manager using Ctrl+Alt+Del and see what other software is hogging/storing/using recourses. Stop some and try to reopen your excel file. I'm guessing some cute "fast start" software is keeping Excel from thinking it is opening a new file as it is already in memory (or something like that).

    Is this machine a full windows machine? Microsoft came out with a Window 10 S version that wouldn't run old apps. Are you using that OS?

  12. #12
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: On open event

    Windows 10 Pro

  13. #13
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: On open event

    Nothing seems to be helping. What would prevent any On Open event from working? All other Macros and code are working. If I run the code in the VBA editor everything works as it should.


  14. #14
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: On open event

    Did you try what I suggested in post#5?

  15. #15
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: On open event

    kev_, yep nothing works in the

    Private Sub Workbook_Open()

  16. #16
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: On open event

    Hi,

    What if you move the code to a normal module and use Auto_Open
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  17. #17
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: On open event

    Did you try what I suggested in post#5?
    Kev_, yep nothing works in the
    Private Sub Workbook_Open()
    I do not understand your answer

    suggestion in post#5 was:
    Put code below in a SHEET module and select a cell in that sheet
    Does the message pop up?
    Please Login or Register  to view this content.
    ...which does not involve Workbook Open..

  18. #18
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: On open event

    xlnitwit, This seems to work. Any Idea why?

  19. #19
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: On open event

    That suggests, and this is what kev_ was trying to establish too, that you have some code that is disabling events and not re-enabling them.

  20. #20
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: On open event

    Why would that only happen on the Surface Pro and not on my desktop unit?

  21. #21
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: On open event

    Perhaps you have an add-in or other program installed on the Surface that is not on the Desktop and which is interfering.

+ 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] Disable on open event
    By PLD60 in forum Excel General
    Replies: 2
    Last Post: 02-01-2017, 06:52 PM
  2. WorkBook open Event
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-30-2011, 06:02 PM
  3. WorkBook Open Event?
    By zplugger in forum Excel General
    Replies: 7
    Last Post: 12-10-2011, 02:28 AM
  4. Application Open/Close Event - Store Open and Close Times?
    By mccrimmon in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2011, 04:21 PM
  5. Worksheet Open Event
    By muckem333 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-28-2010, 09:54 AM
  6. Open Workbook Event
    By newbie13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2008, 11:56 AM
  7. Need help re VBA for Worksheet Open Event
    By LucyRB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-12-2006, 03:10 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