Avatar of Joe Brown
Joe Brown
 asked on

How can I get a value to return in a VB Script so it will be part of the file path name

Please see below document which is a screen shot. I would like for the ML_LOTSERIALNO$ to return the value to the file path where I have noted 'value'. How can I write the script so that it wit will do this?
Doc3.doc
Visual Basic ClassicVB Script

Avatar of undefined
Last Comment
Joe Brown

8/22/2022 - Mon
prashanthd

Could you specify more details and complete requirements

regards
Prashanth
ASKER CERTIFIED SOLUTION
Alan_White

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Joe Brown

ASKER
I hava tried this and I get an error on script line #27

  27 : objShell.ShellExecute("M:\Quality Logs\Quality Logs\Master-CofA File\" & ML_LOTSERIALNO$ & ".pdf")

I attached a screen shot of the error I received
Doc2.doc
Joe Brown

ASKER
I removed the $ from the field name and it worked! :) This is the final code that I used.
Thank you!

' Use ShellExecute to open a particular file
Set objShell = CreateObject("Shell.Application")

objShell.ShellExecute( "M:\Quality Logs\Quality Logs\Master-CofA File\" & ML_LOTSERIALNO & ".pdf" )
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes