Results 1 to 8 of 8

What's the best way to execute code on a protected chart?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-24-2006
    Location
    Los Angeles
    MS-Off Ver
    2019
    Posts
    328

    What's the best way to execute code on a protected chart?

    Hi,

    I have some code that changes the axis of an embeddes chart when a user pressed a button. Trouble is, that worksheet and the chart are supposed to be password protected and the code will not work on a protected chart...it blows up.

    What is the best way to have the code work and to still have the chart and sheet protected? Do I need to have code unprotect the chart first? Is that a secure thing to do?

    Sub ChangeAxisScales()
        With ActiveSheet.ChartObjects("Chart5").Chart
    
            ' Category (X) Axis
            With .Axes(xlCategory)
    '           .CrossesAt = 1
                .TickLabelSpacing = Range("Chart5MajorXTicks")
    '           .TickMarkSpacing = 2
    '           .AxisBetweenCategories = True
    '           .ReversePlotOrder = False
            End With
        End With

    Lawrence
    Last edited by skysurfer; 04-22-2010 at 10:58 AM.

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