View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Robin Hammond[_2_] Robin Hammond[_2_] is offline
external usenet poster
 
Posts: 575
Default Getting system directories

Fred,

This goes slightly beyond your question but gives you a way to retrieve most
common system info items. Note the last line in the sub which shows how to
refer to an item by its text identifier.

Sub ListEnvironVariables()
Dim lCounter As Long
Workbooks.Add
For lCounter = 1 To 32
Cells(lCounter, 1).Value = Environ(lCounter)
Next lCounter
Cells(33, 1) = Application.Path & "\XLStart"
Cells(34,1) = Environ("Windir") & "\System32"
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Fred" <leavemealone@home wrote in message
...
How can I get the path names of the "Program files" directory, the
"Windows/system32" directory, and the XLStart directory?

Thanks for your help
Fred