View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jared Jared is offline
external usenet poster
 
Posts: 109
Default How do I use environment variables in Excel?

Try ActiveWorkbook.SaveAs Filename:=ADCMath & "\" & Term & "\" &
ActiveWorkbook.Name

"kfloyd" wrote:

I've defined some environment variables that I want to use to specify a path
to a directory. How do I use these environment variables in the "Save As"
box?

The variables a

"ADCmath" set to "P:\blah"
"TERM" set to "Fall2004"

I want to save an Excel file in the directory P:\blah\Fall2004 by using
%ADCmath%\%TERM%\filename.xls

but it doesn't work.

(And how can something so simple in UNIX be so obtuse in Windows???)

Ken