+ Reply to Thread
Results 1 to 5 of 5

Run-time error '1004' despite UserInterfaceOnly = TRUE

  1. #1
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    477

    Run-time error '1004' despite UserInterfaceOnly = TRUE

    Hi all,

    I have locked all my pivot sheets and set UserInterfaceOnly = TRUE so that I can run my Macro to select and deselect items in a Pivotfield without having to unlock and lock all sheets again. This works fine for the following code:

    Please Login or Register  to view this content.
    Though, if I do the same with below code. It gives me an "run-time error '1004' - cannot edit pivot on protected sheet" and highlights the .ClearAllFilters line when I debug. Does UserInterfaceOnly = TRUE only work for certain type of codes??

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    1,726

    Re: Run-time error '1004' despite UserInterfaceOnly = TRUE

    What does the code, with "UserInterfaceOnly = TRUE", look like and where is it located ?

  3. #3
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    477

    Re: Run-time error '1004' despite UserInterfaceOnly = TRUE

    It is in the ThisWorkbook section and looks like this:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,084

    Re: Run-time error '1004' despite UserInterfaceOnly = TRUE

    Quote Originally Posted by esbencito View Post
    Does UserInterfaceOnly = TRUE only work for certain type of codes??
    Yes. It works most of the time but not all of the time. I do not know of any list of what will not work though.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Contributor
    Join Date
    07-13-2017
    Location
    Hong Kong
    MS-Off Ver
    MS Office 365
    Posts
    477

    Re: Run-time error '1004' despite UserInterfaceOnly = TRUE



    That's not what I was hoping to hear, but at least it explains why it doesn't seem to work for the above case. Thanks for enlightening me!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Protect UserInterFaceOnly:=True ONLY to VISIBLE worksheets WITHOUT a password
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-07-2017, 10:20 AM
  2. Replies: 0
    Last Post: 08-01-2016, 03:47 PM
  3. Hiding Columns with Macros in protected sheets with userinterfaceonly=True
    By keithwins in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 01-10-2015, 01:53 PM
  4. Changing Locked property of cells in Protected sheet with option UserInterfaceOnly=True
    By MathUKTeacher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2014, 07:34 AM
  5. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  6. Worksheet.Protection userinterfaceonly:=true problem
    By Kained in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2009, 04:51 AM
  7. .protect userinterfaceonly:=true not working?
    By dreamz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2006, 07:31 PM

Tags for this Thread

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