Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default run vbs from vba Syntax

i'm trying to run convert2pdf.vbs from vba:

Call Shell("WScript.exe """ & ThisWorkbook.Path & "\Convert2PDF.vbs", vbMinimizedNoFocus)

Get message Syntax convert2pdf.vbs <Filename

Can't figure out how to do this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default run vbs from vba Syntax

"Jerry V" wrote:
Call Shell("WScript.exe """ & ThisWorkbook.Path & "\Convert2PDF.vbs",
vbMinimizedNoFocus)

Get message Syntax convert2pdf.vbs <Filename
Can't figure out how to do this.


You are missing a double-quote after the path name. The correct syntax is:

Call Shell("WScript.exe """ & ThisWorkbook.Path & _
"\Convert2PDF.vbs""", vbMinimizedNoFocus)

or to minimize misreading in certain fonts:

Call Shell("WScript.exe " & Chr(34) & ThisWorkbook.Path & _
"\Convert2PDF.vbs" & Chr(34), vbMinimizedNoFocus)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is Access VBA syntax different from Excel syntax? cr113 Excel Programming 2 December 2nd 09 12:42 AM
Syntax HELP Eric H Excel Discussion (Misc queries) 4 August 30th 08 01:30 AM
Help with syntax kirkm[_6_] Excel Programming 2 March 7th 07 08:04 AM
Syntax help! Mike Fogleman Excel Programming 20 July 30th 05 01:11 PM
syntax libby ~xl97 Excel Programming 1 November 19th 03 05:09 PM


All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"