Re: Running Excel as a batch job AND in the background

G

GB

Robert Stober said:
Thank Andy! This worked for me! I edited your command as follows:

Set xlObj = CreateObject("Excel.application")
xlObj.Workbooks.Open "H:\licana\licuser\orders\22345585\template.xls"
xlObj.Quit

Can I use an environemnt variable inside VB? I want the order number
("22345585" in this case) to be contained in an enviroment variable. This is
what I do inside aVBA template:

Dim orderNum As Long
Dim fPath As String
orderNum = Environ("orderNum")
fpath = "H:\licana\licuser\orders\" & orderNum & "\template.xls"

Can I do this in VB? My book doesn't mention enviroment variables...

How about saving it in the registry instead? - use SaveSetting to store and
getsetting to get it back.

HTH

Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top