+ Reply to Thread
Results 1 to 5 of 5

Error 1004 when running macro on a different computer

  1. #1
    Registered User
    Join Date
    09-06-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Unhappy Error 1004 when running macro on a different computer

    Hi,

    I've written some VBA code which manipulates a pivot table for the purposes of populating a generated report (via code later in the macro). The code runs without error on my computer, but runs into "Error 1004 unable to set the visible property of the pivotitem class" on all 3 other computers I've tried to run this on.

    Here is the code it gets tripped up on (specifically when setting the Visible property in my pivot table):

    Please Login or Register  to view this content.

    -There are no file location specific references in my code
    -Excel versions are exactly the same (14.0.6123.5001)
    -No add-ins in VBA or Excel installed on my or other computer
    -There are no external references
    -I have also tried modifying the code to recreate all pivot tables each time the macro runs, to no avail

    I have run out of ideas. Has anyone else run into an issue like this?

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Error 1004 when running macro on a different computer

    Hi Coalsand and welcome to the forum,

    See if these help
    http://support.microsoft.com/kb/964294
    http://stackoverflow.com/questions/3...table-with-vba
    http://www.ozgrid.com/forum/showthread.php?t=30157
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-06-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Error 1004 when running macro on a different computer

    Thanks for the quick reply Marvin,

    The links you referred to don`t appear to be applicable to my situation.

    The code runs without error on my computer. I have also renamed the workbook and tried running it in different locations (locally and on network) without issues. It is when the macro is run on a different computer (so far 3 other computers) where it produces Error 1004 when trying to change a Pivot Item property. Modifying the code so that it deletes the existing pivot table and producing a new one does not eliminate the issue.

  4. #4
    Registered User
    Join Date
    09-06-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Error 1004 when running macro on a different computer

    Just a quick update - I've confirmed that this macro is running properly on 2 computers, and erroring as described on 3.

  5. #5
    Registered User
    Join Date
    09-06-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Error 1004 when running macro on a different computer

    Well I've figured it out and since it doesn't appear to be documented anywhere in relation to this sort of problem, I'll post here. Apparently this has to do with Excel's handling of "Enable Content". While it had asked to enable content and it was enabled, for some reason, the flag doesn't clear until it is saved from that computer and re-opened.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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