+ Reply to Thread
Results 1 to 7 of 7

Add TableStyle To TableStyles Collection Error

  1. #1
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Add TableStyle To TableStyles Collection Error

    Hi all,

    Using Excel 2013.

    Trying to add a TableStyle to the TableStyles Collection in a workbook.

    I receive this error message - not sure why?

    Thx
    w

    Run-time error '5':
    Invalid procedure call or argument
    Please Login or Register  to view this content.
    Kind regards,
    w

    http://dataprose.org

  2. #2
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Add TableStyle To TableStyles Collection Error

    Bump.

    thx
    w

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Add TableStyle To TableStyles Collection Error

    Does the name you're trying to add match an existing style?
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Add TableStyle To TableStyles Collection Error

    Thanks Rory,

    I manually created a couple of Styles and named them tsData1, tsData2 and tsData3
    I really just want to figure out how to rename them using VBA.
    I did not see that option so I thought I could Add new Styles named tsCustomData1,....
    And then delete the original Custom Styles

    thx
    w

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Add TableStyle To TableStyles Collection Error

    Your code works fine for me unless the code is trying to add a style using a name that matches an existing name.

  6. #6
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: Add TableStyle To TableStyles Collection Error

    Thanks Rory,

    My problem was that after trying to add, i tried listing all TableStyles and I did not see the new Styles because i was using ts.ShowAsAvailableTableStyle.
    Apparently when adding a TableStyle it is not given a "Show" Proporty?

    • .ShowAsAvailablePivotTableStyle
    • .ShowAsAvailableSlicerStyle
    • .ShowAsAvailableTableStyle



    thx
    w

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Add TableStyle To TableStyles Collection Error

    You might try duplicating instead:
    Please Login or Register  to view this content.
    Note that if your existing styles are in use, this will revert the tables to the default style.

+ 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. [SOLVED] Performance of iteration through Words collection degrades as collection gets bigger
    By 6StringJazzer in forum Word Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2014, 09:44 AM
  2. Run time error 13 with new Collection
    By Tomkat743 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2006, 07:50 AM
  3. [SOLVED] Collection from Range, tag cells on error
    By nowon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-02-2006, 08:40 PM
  4. Error with passing collection as parameter
    By McManCSU in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2005, 02:05 PM
  5. Automation Error(-2147467259) in Properties Collection
    By VJ in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-14-2005, 03:06 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