Results 1 to 2 of 2

Sub not working when called

Threaded View

  1. #1
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Office 365
    Posts
    55

    Question Sub not working when called

    I have a code that works perfect when run directly, it looks like this:

    Sub Protect()
    
        ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:= _
            False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
            AllowFormattingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
            AllowUsingPivotTables:=True
    End Sub
    Nothing magic about that.

    Now, like i said, this works as it should when i run it directly. But i have several checkboxes that generate graphs etc, and i use Call to run protect and unprotect. When calling, users can't adjust rows or columns, when rightclicking on a row most options are greyed out.
    So basically it does not work as it should, and as it does when run direct.

    Any suggestions?
    Last edited by tigergutt; 09-13-2016 at 10:28 PM.
    kind regards
    tigergutt

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro not working properly when called from Button (Running otherwise)
    By AnimeshRoy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2016, 10:39 AM
  2. Last Sub not working when called
    By BGUNN in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-09-2015, 08:24 AM
  3. FreesePanes not working if XMTL is called from VBS
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2014, 02:47 PM
  4. Add-In not working when Excel called from command line
    By tweaver60 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-31-2012, 12:01 PM
  5. Application.WorksheetFunction stops working if the Sub is called
    By emmalg in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-03-2011, 09:28 AM
  6. UDF working when called from Sub, doesn't work as worksheet function
    By stevenf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2009, 07:32 PM
  7. Private sub not working correctly when called from another macro
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2008, 08:16 PM

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