Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Registry Default File Location Prevents Shell
In my installation of Excel (Office 2003) a default setting (Tools Options
General - Default File Location) seems to be set from a registry key (HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CUR RENTVERSION\EXPLORER\DocFolderPaths). This setting is set every time my machine is rebooted even if you delete the path in Excel via Tools Options General. If you delete the registry key then this setting is empty. The problem I have is that this setting seems to prevent the Shell command from working properly. I attach the code below. i.e If I run the code with a file path specified in the Default File Location the code does not run (i.e launch the specified exe) if this setting is clear then the code runs fine. The code Public Sub ShellAndWait(ByVal PathName As String, Optional WindowState) Dim hProg As Long Dim hProcess As Long, ExitCode As Long If IsMissing(WindowState) Then WindowState = 1 hProg = Shell(PathName, WindowState) hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, hProg) Do GetExitCodeProcess hProcess, ExitCode DoEvents Loop While ExitCode = STILL_ACTIVE End Sub Any ideas would be much appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Default file location | Excel Discussion (Misc queries) | |||
Default file location | Setting up and Configuration of Excel | |||
Default file location keeps on changing | Excel Discussion (Misc queries) | |||
default file location | Excel Discussion (Misc queries) | |||
Default File Location | Excel Programming |