Click to See Complete Forum and Search --> : Macro No Longer Works
whitesmith
October 6th, 2005, 01:18 PM
I have been using a Developer Studio Macro (VBS) for years. I last used it in September. This month it does absolutely nothing, even though I've made no changes whatever. The relevant code is:
Dim objShell
Set objShell = CreateObject("Shell.Application")
cmdParms = "notepad.exe"
objShell.Run cmdParms
I always run the latest MS updates on my PC, so I'm thinking MS may have hobbled something for security reasons. Thoughts and ideas are welcome.
PeejAvery
October 7th, 2005, 08:21 PM
With what you have given the best thing to do is check the default windows paths. Make sure that if you just type notepad from command prompt that you can run it.
whitesmith
October 8th, 2005, 10:18 AM
Notepad comes up fine from Start/Run and the command line. This is one of the things that puzzles me.
PeejAvery
October 9th, 2005, 09:27 AM
Well, try stripping the code down to bare minimum and run it on your machine. Also are other scripts running on your machine?
whitesmith
October 9th, 2005, 05:06 PM
Here's the simplest possible code:
Sub Test()
Dim objShell
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "notepad.exe", "", "", "open", 1
Set objShell = Nothing
MsgBox( "Macro terminating ..." )
End Sub
When I run the macro I get a message box originating in Notepad that says, "Access to the specified device, path, or file is denied." Then my own "terminating" message pops. Same thing happens if I change Notepad to anything else--Ping, for example. No other macros are running. The PC runs Win2K Pro with SP4 and all the latest MS patches. I have admin privileges. Pretty wierd, huh?
PeejAvery
October 9th, 2005, 09:01 PM
Doesn't really make sense. Now, you may have administrative rights but humor me and try logging on as administrator and run it.
whitesmith
October 10th, 2005, 02:02 PM
The behavior is exactly the same when I'm logged on as Administrator. It's as if the macro is empty except for my "terminating" message. Task Manager does not show any hidden processes. I'm totally baffled.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.