+ Reply to Thread
Results 1 to 3 of 3

Misterious Run-time error 1004 on Workbook Open

  1. #1
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Unhappy Misterious Run-time error 1004 on Workbook Open

    I have two versions of the same file and they share the same sheet structure and the same workbook_open event function as follows

    Please Login or Register  to view this content.
    for some reason one of the versions gives Run-time error 1004 when it arrives at line
    ws.Visible = xlSheetVeryHidden

    Run-time error 1004
    method "Visible" of object "_worksheet" failed

    but I cannot understand why. (in the other file with the same workbook_open event there are no issues)
    ws is indeed each of the worksheets and I can access its properties through the inmediate window, but for some reason does not allow changing its visible attributes

    any clues of what may be going on?

    thanks!
    Last edited by bagullo; 10-14-2010 at 03:01 AM. Reason: run-time error, .visible

  2. #2
    Forum Contributor
    Join Date
    09-30-2009
    Location
    Barcelona
    MS-Off Ver
    Excel 2010
    Posts
    274

    Re: Misterious Run-time error 1004 on Workbook Open

    Mistery solved: Do not protect the whole workbook if you want to show and hide sheets programmatically...

    sorry!

  3. #3
    Registered User
    Join Date
    03-26-2014
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Misterious Run-time error 1004 on Workbook Open

    I realize that this is now many years after this post, but in now using Excel 2013 you can avoid this error message if you protect the workbook before running the macro to protect all of the worksheets. Hope this helps with anyone that's still dealing with this issue.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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