PDA

View Full Version : Solved: Application.Help doesn't work on terminal server



JWhite
03-16-2009, 03:38 PM
I've got an Excel VBA application that runs fine on XP, Vista, and Windows Server 2003 except for one thing.

I've got a substantial Help file (".chm" file created with HTML Help Workshop) that the users can call from the application. The code to call the Help file is as follows:

Application.Help (Application.UserLibraryPath & "MyApplication_Help.chm")

Each user has a copy of the .chm file in his UserLibraryPath directory and there was never a problem until we installed it on the terminal server. It doesn't throw off an error. It just executes the instruction and doesn't do anything. For now I've got the users creating a short-cut icon to the .chm file so they can load Help that way. Help works fine when it's called that way.

I've found some articles like this one: http://support.microsoft.com/kb/896358. It seems to indicate that Microsoft has done something deliberately in Windows Server to plug a security hole and now my application doesn't work. Since ".chm" files are executables they are considered dangerous. I've read the articles and it seems like they're saying you can alter the registry to make it work. But my customers don't want me altering their registries and I'm trying to find another approach.

Is there another way to call the Help file? Part of my system is in VB.Net and it doesn't work from there, either. I've posted on Microsoft's forums and no one has answered. If anyone has any ideas I would really appreciate it.

JWhite
03-19-2009, 06:25 AM
I've solved my own problem. I had been searching for an alternative way to call the Help application but every approach I tried either didn't work or triggered a warning from Windows that I was trying to load a potentially dangerous file. For some reason, the following approach is the only way I can get it to work on Windows Server 2003 without getting an error message:

Shell("hh.exe " & Application.UserLibraryPath & "MyApplication_Help.chm", 1)

The Shell command can be used to execute any program from VBA. "hh.exe" is the Microsoft HTML Help program which loads the ".chm" file. It's located in C:\Windows so it's not necessary to specify the full path. "MyApplication_Help.chm" is the name of the compiled Help file. The "1" parameter says to open a normal-sized window.

This also works on XP and Vista so I've replace my "Application.Help" code with the above and everything works fine.