View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Charles Jordan Charles Jordan is offline
external usenet poster
 
Posts: 56
Default Shell command stopped working: is it part of Excel 95 , or Windows?

(Charles Jordan) wrote in message . com...
"Tom Ogilvy" wrote in message ...
Shell is a native command to VBA/VB

It is possible they are using that library, but seems unlikely. One never
knows. Seems if that were the case, rather than nothing happens, they would
get a missing library error message.


Tom thanks.
On machine A, it works under XP with no references to any library set
up .
On machine B, (again, XP, no references), it bombs with "Invalid
procedure call" at the line containing the Shell command. The .htm
file IS there, in the correct folder.

Where please can I find the setting or switch for "error suppression
in place " ?? We've not heard of it.

Our code is below this. Any more ideas ? Personally, I suspect that
the Excel 95 installation may have been corrupted, so if I reinstall
XL 95, have I then got to also reinstall Excel 2003 ? (which we need
on the same machine)

Thanks Charles

Sub NewOpenHTM()
Dim XX As Long
On Error Resume Next

Range("URL").Value = Range("Rootpath").Value & MyHtmpath & "\"
& ChosenHTMtext & ""

If Range("VersionNo").Value < 8 Then 'Excel version number
XX = Shell("start " & Range("URL").Value, 2)
MsgBox XX
Exit Sub
Else
ActiveDialog.Focus =
ActiveDialog.Buttons("ForwardButton").Name
Application.Run "V9addin.xla!GetTheHtm"
Exit Sub
End If
End Sub
'-----------------------------------



Tom Ogilvy - I don't know if you are on line, but

(1) will I do any harm if I reinstall Excel 95 on top of Excel 2003 ?

(2) Do we need any references to a library as Chris has suggested ?

Thanks - Charles