Results 1 to 7 of 7
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Chart Print Preview in a Protected Worksheet (2003)

    If you open the attached file and click the print preview button, you can see the chart is selected to print. Is there a way to protect the worksheet holding the chart and still have the chart selected in print preview when you open the file?
    Attached Files Attached Files

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

    Re: Chart Print Preview in a Protected Worksheet (2003)

    Create a Workbook_Open event procedure in the ThisWorkbook module:
    <code>
    Private Sub Workbook_Open()
    Worksheets("Foglio1").ChartObjects(1).Chart.PrintP review
    End Sub
    </code>
    This will work even if the workbook is protected.

    Alternatively, you can place the chart in its own sheet and make that the active sheet.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chart Print Preview in a Protected Worksheet (2003)

    Thank you Hans, is there a way to avoid the print preview popping up as soon as you open the file?
    Attached Files Attached Files

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

    Re: Chart Print Preview in a Protected Worksheet (2003)

    Sorry, I have apparently misunderstood your question. You asked
    <hr>... have the chart selected in print preview when you open the file?<hr>
    What exactly do you mean by that, if you do *not* want print preview? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chart Print Preview in a Protected Worksheet (2003)

    Sorry Hans, when you opened the original unprotected worksheet and clicked the print preview button, the chart was selected to print. If you protected the worksheet , you lost that capability. I was wondering if there's a way to protect the worksheet and still see the chart in print preview when you click the print preview button but not having the print preview window pop right up when you open the file.

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

    Re: Chart Print Preview in a Protected Worksheet (2003)

    If you allow "Edit objects" when you protect the worksheet, you can select the chart when the workbook is opened:
    <code>
    Private Sub Workbook_Open()
    Worksheets("Foglio1").ChartObjects(1).Select
    End Sub
    </code>
    If you don't want to allow "Edit objects", there is no way to select the chart. In that case, I'd place the chart in a chart sheet instead.

  7. #7
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Alzano Lombardo, Italy
    Posts
    1,483
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Chart Print Preview in a Protected Worksheet (2003)

    That's perfect <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Thank you Hans <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

Posting Permissions

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