Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear all,
I thought there was an easy way to get the windows system directory but I can't find it. Anybody an idea? Thanks, JOhn |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
%windir%
You can put that directly into a path. -- Regards, Bill Lunney www.billlunney.com "John" wrote in message ... Dear all, I thought there was an easy way to get the windows system directory but I can't find it. Anybody an idea? Thanks, JOhn |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bill for your quick reply,really appreciated.
However... I am not sure how to use and can't find help on it. I am trying to replace the "c:\winnt\" in the following code so help will always be found no matter where my xla is called from: Sub ShwHelp() Application.Help "C:\WINNT\TPBQ.CHM" '%windir% End Sub Any idea? Thanks for your help. John -----Original Message----- %windir% You can put that directly into a path. -- Regards, Bill Lunney www.billlunney.com "John" wrote in message ... Dear all, I thought there was an easy way to get the windows system directory but I can't find it. Anybody an idea? Thanks, JOhn . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In Excel XP, I can do the following....
Sub Demo() Dim s s = Application.OperatingSystem ' If you want to test s = CreateObject("Scripting.FileSystemObject").GetSpec ialFolder(0) Debug.Print s End Sub Returns... C:\WINDOWS -- Dana DeLouis Using Windows XP & Office XP = = = = = = = = = = = = = = = = = "John" wrote in message ... Thanks Bill for your quick reply,really appreciated. However... I am not sure how to use and can't find help on it. I am trying to replace the "c:\winnt\" in the following code so help will always be found no matter where my xla is called from: Sub ShwHelp() Application.Help "C:\WINNT\TPBQ.CHM" '%windir% End Sub Any idea? Thanks for your help. John -----Original Message----- %windir% You can put that directly into a path. -- Regards, Bill Lunney www.billlunney.com "John" wrote in message ... Dear all, I thought there was an easy way to get the windows system directory but I can't find it. Anybody an idea? Thanks, JOhn . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In a command window you can do
Echo %windir% and it returns C:\Winnt on my system. Not sure how you would use it in VBA You can check the comspec environment variable ? environ("comspec") C:\WINNT\system32\cmd.exe or ? environ("windir") C:\WINNT I am on Win 2K and I can't guarantee that these environ variables will be defined on every OS version. Other methods: http://support.microsoft.com/default...b;en-us;170728 OFF97: Macro to Get Windows and Windows System Directories http://support.microsoft.com/default...b;en-us;213496 XL2000: Macros to Return Windows and System Directory Paths http://support.microsoft.com/default...b;en-us;108278 XL: Macros to Return Windows and System Directory Paths -- Regards, Tom Ogilvy "John" wrote in message ... Thanks Bill for your quick reply,really appreciated. However... I am not sure how to use and can't find help on it. I am trying to replace the "c:\winnt\" in the following code so help will always be found no matter where my xla is called from: Sub ShwHelp() Application.Help "C:\WINNT\TPBQ.CHM" '%windir% End Sub Any idea? Thanks for your help. John -----Original Message----- %windir% You can put that directly into a path. -- Regards, Bill Lunney www.billlunney.com "John" wrote in message ... Dear all, I thought there was an easy way to get the windows system directory but I can't find it. Anybody an idea? Thanks, JOhn . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert military date system to standard date system | Excel Discussion (Misc queries) | |||
How do I open an Excel file on XP system, saved on a Vista system | Excel Discussion (Misc queries) | |||
not enough system resources | Excel Discussion (Misc queries) | |||
system clipboard | Excel Discussion (Misc queries) | |||
excel causing system to be in low system resource | Excel Discussion (Misc queries) |