+ Reply to Thread
Results 1 to 3 of 3

Max string length of Shape.Fill.UserPicture(PictureImage as String)?

  1. #1
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Max string length of Shape.Fill.UserPicture(PictureImage as String)?

    I've searched MSDN and elsewhere, but to no avail.

    Does anyone know the exact maximum string length allowed, referenced as "sURL" in the snippet below?
    Please Login or Register  to view this content.
    So far, I get an (Error 5) when LEN(sURL) = 1066, but do not get error when LEN(sURL) = 340.

    Thanks,

    -ds-
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Max string length of Shape.Fill.UserPicture(PictureImage as String)?

    Hello AlvaroSiza,

    Based on the internal path length for API Unicode strings, I would say 520 characters.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Max string length of Shape.Fill.UserPicture(PictureImage as String)?

    Thanks Leith.

    There is documentation to indicate theoretical limits for strings at 2 GB (2^31 chars, or ~2 billion chars). That said, some of the built in functions have much smaller limits (such as msgbox = 1024, etc.). It would appear that Shape.Fill.UserPicture would have a cap in place as well.

    I'm essentially building a URL string in an array and passing that to the Google Static Maps (v2) API, which then renders in an msoShapeRectangle. To expand, is there another approach I am not considering to get around the apparent limitations?

+ 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