Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shell to Excel (2003)

    I have a folder with a space in the name called Performance Information.
    The command
    Shell "EXCEL.EXE charliedocumentsPerformance Information18WeekMonitoring.xls", vbNormalFocus
    tries to open a spreadsheet called Performance.xls instead of 18WeekMonitoring.xls (and one called Information18WeekMonitoring.xls)
    How do I need to alter the code the specify the folder Performance Information (changing the folder name is not an option!)
    Thanks
    Allison

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Shell to Excel (2003)

    You must enclose the path/filename in quotes, and since it's within a quoted string, you must double the double quotes:
    <code>
    Shell "EXCEL.EXE ""charliedocumentsPerformance Information18WeekMonitoring.xls""", vbNormalFocus
    </code>
    or use Chr(34):
    <code>
    Shell "EXCEL.EXE " & Chr(34) & "charliedocumentsPerformance Information18WeekMonitoring.xls" & Chr(34), vbNormalFocus</code>

  3. #3
    2 Star Lounger
    Join Date
    Oct 2001
    Location
    Suffolk, England
    Posts
    134
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shell to Excel (2003)

    Thanks - fixed!
    Allison

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •