Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Can't disable the gridlines (Excel 2002)

    Hi

    I have a worksheet called "Info" and I used the Tools Options to turn off the gridlines, No problem there, and as you can see from the workbook open event its covered there.

    However whilst the timer (Supply by Hans) is running the gridlines appear, If I go the the Worksheet once the timer has closed it , the gridlines are not there.

    So my question is why do they appear whilst the timer is running.

    Many Thanks Braddy

    Private Sub Workbook_Open()
    Sheets("Intro").Visible = True
    ActiveWindow.DisplayGridlines = False
    Application.Cursor = xlWait
    Worksheets("Intro").Activate
    Application.Wait Now + TimeSerial(0, 0, 5)
    Worksheets("Input").Activate
    Application.Cursor = xlDefault

    Sheets("Intro").Visible = False
    ActiveWindow.DisplayGridlines = False
    Sheets("Input").ScrollArea = "$A$1:$Q500"
    End Sub
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Can't disable the gridlines (Excel 2002)

    The first occurrence of ActiveWindow.DisplayGridlines = False is executed AFTER the Intro sheet is made visible, but BEFORE it is made the active sheet. The gridlines are turned off in the active sheet, which is still Input at that moment. If you place the line ActiveWindow.DisplayGridlines = False between the line that activates the Intro sheet (Worksheets("Intro").Activate) and the line with the Wait method, the gridlines in Intro will be turned off.

    But why don't you turn off the gridlines interactively before saving the workbook? They'll still be off when the workbook is opened.

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Can't disable the gridlines (Excel 2002)

    Hi Hans

    Thank you for your instruction.

    NB I did turn the gridlines off interactively as mentioned in my post, but they still appeared on start up, when I went to the info sheet after it had closed the grinlines were absent.

    I did what you instructed and it works fine now.

    Many thanks
    Braddy
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •