Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default file location Marvin Excel Discussion (Misc queries) 1 April 16th 08 08:46 PM
Default file location hmburg52 Setting up and Configuration of Excel 2 January 25th 07 10:02 AM
Default file location keeps on changing code_master Excel Discussion (Misc queries) 1 July 4th 05 01:46 PM
default file location maryj Excel Discussion (Misc queries) 2 March 3rd 05 06:09 PM
Default File Location Kevin Excel Programming 1 November 9th 04 10:07 AM


All times are GMT +1. The time now is 03:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"