Results 1 to 3 of 3

Misterious Run-time error 1004 on Workbook Open

Threaded View

bagullo Misterious Run-time error... 10-14-2010, 03:00 AM
bagullo Re: Misterious Run-time error... 10-14-2010, 03:18 AM
geoff321 Re: Misterious Run-time error... 04-01-2014, 10:09 AM
  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

    Private Sub Workbook_Open()
        Dim ws As Worksheet
        
        With ThisWorkbook.Worksheets("QCT Global")
            With .DeliveryLot
                .Clear
                .AddItem "Current Lot"
                .AddItem "Manual Lot"
                .Value = ThisWorkbook.Worksheets("QCT Global").Range("E3")
            End With
            .Visible = xlSheetVisible
            .Activate
            .Cells(1, 1).Select
            ActiveWindow.Zoom = 65
        End With
        
        For Each ws In ThisWorkbook.Worksheets
            If Not ws.Name = "QCT Global" Then
                ws.Visible = xlSheetVeryHidden
            End If
        Next ws
    
    End Sub
    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

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