+ Reply to Thread
Results 1 to 2 of 2

Passing variables from VBA to VBScript

  1. #1
    Registered User
    Join Date
    01-04-2013
    Location
    United Kingdom
    MS-Off Ver
    Office 2013
    Posts
    40

    Question Passing variables from VBA to VBScript

    Hi all,

    I'd like to run some VBscript code from within VBA, which is fine as I can do so with this type of command... Shell strPathName, vbNormalFocus. But I need to pass some variables to the VBscript code, which I can do via... Shell strPathName & " " & variable1 & " " & variable2, vbNormalFocus. However, all I can pass here are basic variables like strings. What I'd like to be able to pass are classes or data objects. Is that at all possible when running VBscript via the shell command?

    Many thanks,

    Chris

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Passing variables from VBA to VBScript

    you said:

    But I need to pass some variables to the VBscript code, which I can do via... Shell strPathName & " " & variable1 & " " & variable2, vbNormalFocus.

    of course you can. because strings are read by the shell command as part of the pointer.

    However, all I can pass here are basic variables like strings. What I'd like to be able to pass are classes or data objects. Is that at all possible when running VBscript via the shell command?

    no it's not possible. using the shell command runs a file pointer / program. how could you pass objects to a windows feature that has a primary purpose of executing commands procedurally? arguments for commands are not programming objects.

    unless i'm mistaken....

+ 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. Passing Variables
    By GS7clw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2014, 01:18 PM
  2. Passing Variables to Sub
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-21-2010, 01:28 AM
  3. Passing variables
    By Zrx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-04-2009, 06:45 AM
  4. Passing variables
    By lordfa9 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-17-2007, 06:33 AM
  5. Passing Variables
    By Jeff in forum Excel General
    Replies: 1
    Last Post: 11-04-2005, 02:50 PM
  6. Passing variables from one sub to another
    By Yasha Avshalumov in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-19-2005, 12:05 PM

Tags for this Thread

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