+ Reply to Thread
Results 1 to 3 of 3

Comma is Stopping My Shell("explorer.exe") Call

  1. #1
    Registered User
    Join Date
    02-05-2011
    Location
    Rowlett, Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Comma is Stopping My Shell("explorer.exe") Call

    I have created an add-in that does several tasks for our staff accountants. The problem I am having is in one of the userform buttons. The task is to view the current month's folder where the individual reports reside for the current financial package. I have replaced variables in my code example with typical values. The following procedure retuns an error that includes the path after the comma in DeSoto Ranch..., Inc. Basically, the code ignores the path before the comma. The commas are used in the name of the read-only folders on our network drive. Not all names have commas, and those properties do not return errors when the button is pushed. One solution is to ask IT to change the names. (I am a staff accountant and not a full time developer), but the challenge is too intriguing. There must be a way (my Excel VBA battelcry). Another solution is to create (with code) a shape with a hyperlink to open the folder. I have created a text link (with VBA), but it's not aesthetic. I can create a shape button/link without VBA, but it doesn't replicate for our 180 clients.

    Here is the code for the Distribution Folder button on my userform that returns an error whenever the property name has a comma:

    Please Login or Register  to view this content.
    This is my first post, so I hope I have included the right info and not too much background.

    Thanks,

    Donn
    Last edited by dgilray; 02-05-2011 at 08:28 PM. Reason: Question Answered

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

    Re: Comma is Stopping My Shell("explorer.exe") Call

    I think you'll need to enclose the str_folder bit in double quotation marks:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    02-05-2011
    Location
    Rowlett, Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Comma is Stopping My Shell("explorer.exe") Call

    That worked!! I had resolved to make the button macro linked to a hidden cell with the hyperlink and activate the hyperlink that way - then I checked back here.

    Thanks, Romper!

+ 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