+ Reply to Thread
Results 1 to 5 of 5

Can not Print Embedded Graph on Protected Worksheet with Macro

  1. #1
    Forum Contributor
    Join Date
    05-02-2012
    Location
    Mosselbaai, Suid Afrika
    MS-Off Ver
    Excel 2016
    Posts
    107

    Can not Print Embedded Graph on Protected Worksheet with Macro

    The worksheet is protected and the object(i.e. embedded graph) is protected. I want to print the graph with a macro but get the following error message:
    "Run-time error '1004'
    Activate method of ChartObject class failed."

    Tried to use
    Please Login or Register  to view this content.
    , but still does not allow printing of the graph as per code below.

    Please help.
    Tnx

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Can not Print Embedded Graph on Protected Worksheet with Macro

    Hallo Henk Stander,

    Goeie naand,

    At the beginning of your Code as shown above enter:

    Please Login or Register  to view this content.
    and at the bottom of the Code:

    Please Login or Register  to view this content.
    Where "Sheet Name" = Actual Sheet Name, And "PassWord" = Actual Password for the Sheet.

    Voorspoed.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Contributor
    Join Date
    05-02-2012
    Location
    Mosselbaai, Suid Afrika
    MS-Off Ver
    Excel 2016
    Posts
    107

    Re: Can not Print Embedded Graph on Protected Worksheet with Macro

    Goeie môre Winon,

    Thank you for the speedy reply. Is there a way to do it without having to "unprotect" the sheet?

    Baie dankie,
    Henk

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Can not Print Embedded Graph on Protected Worksheet with Macro

    Goeie More Henk,

    No. When you run the Macro it first UnProtects the Sheet, and after it has done printing, the Macro Protects the Sheet again.

    So there is nothing to worry about.

    To make it even safer you could also consider to disable the "Esc" key at the start of your code, and then re-enable it again at the end of your Code.

    Probeer dit gerus!

  5. #5
    Forum Contributor
    Join Date
    05-02-2012
    Location
    Mosselbaai, Suid Afrika
    MS-Off Ver
    Excel 2016
    Posts
    107

    Re: Can not Print Embedded Graph on Protected Worksheet with Macro

    Dankie Winon,

    I will do so.

    Tnx
    Lekker dag

+ 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