+ Reply to Thread
Results 1 to 7 of 7

Run-time error....but only on 1 computer

  1. #1
    Registered User
    Join Date
    09-02-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Run-time error....but only on 1 computer

    I'm hoping that someone can help me crack this one - I have 2 computers setup to run reports in Excel, and the files used on my desktop have been copied directly into the same directory on my laptop.

    On my desktop they run smooth, but if I run on the laptop it gives me the following error:

    Run-time error '-2147417848 (80010108)':
    Method 'CreatePivotTable' of object 'PivotCache' failed.

    The highlighted error in the VBA:

    Please Login or Register  to view this content.
    Any ideas to how that can be...?
    Last edited by nulrichster; 01-10-2011 at 03:21 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Run-time error....but only on 1 computer

    Presumably the Desktops are running an XL version prior to XL2007 - and the laptop ?
    (XL2007+ utilises .Create rather than .Add I believe)

  3. #3
    Registered User
    Join Date
    09-02-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Run-time error....but only on 1 computer

    I used to have Office2003 on both of them, where I got the same error. The laptop is now running Office2007, but still without any difference
    Last edited by DonkeyOte; 01-10-2011 at 03:54 AM. Reason: removed unnecessary quote

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Run-time error....but only on 1 computer

    PivotCaches.Add does not exist in XL2007+ replaced by .Create which does not exist prior to XL2007.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Run-time error....but only on 1 computer

    edit: ignore that .. the .Add method will work in XL2007 apologies for misinformation

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Run-time error....but only on 1 computer

    Can you outline how utvalg is declared ?
    (if utvalg is valid range for ex. the code works for me in XL2007 without issue)

    edit: also check you have no empty headers etc...
    Last edited by DonkeyOte; 01-10-2011 at 04:51 AM.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Run-time error....but only on 1 computer

    nulrichster

    Is that all the code?

    Have you tried breaking it down into adding the pivot cache and then creating the pivot table separately.
    Please Login or Register  to view this content.
    That might not solve the problem but it might give some more insight to what's happening.

    One thing I did notice when testing that code was that both TableDestination and TableName could cause errors.

    The latter errored when I tried specifying the destination and there was already a pivot table in that area.

    The former basically when using the same name.

    Both kind of obvious I suppose.

+ 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