Shell command stopped working: is it part of Excel 95 , or Windows?

  • Thread starter Thread starter Charles Jordan
  • Start date Start date
C

Charles Jordan

Hi - we are testing a product on a variety of platfoms, including an
Excel version 7.0 (95) version. On machine A , running Windows XP, it
works fine. On Machine B also under XP, nothing happens when we call
the Shell, so we probably need to reinstall something.

But is that Excel 95, or Windows XP ?

TIA _ Charles
 
Did you check to see if there is a reference to The Shell object library

----- Charles Jordan wrote: ----

Hi - we are testing a product on a variety of platfoms, including a
Excel version 7.0 (95) version. On machine A , running Windows XP, i
works fine. On Machine B also under XP, nothing happens when we cal
the Shell, so we probably need to reinstall something

But is that Excel 95, or Windows XP

TIA _ Charle
 
Shell is part of VBA.

I don't know what object library Chris is talking about. Perhaps he could
elaborate.


I suspect you have error suppression in place and whatever you are shelling
to doesn't exist or isn't accessible on the machine where the failure
occurs.
 
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 Ogilvy said:
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 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
 
If Range("VersionNo").Value < 8 Then 'Excel version number
XX = Shell("start " & Range("URL").Value, 2)
MsgBox XX
Exit Sub
Else

Would require that you have an application associated with the extension of
your file spec in Range("URL")

If not, then start wouldn't know what application to start. If that is the
case, it has nothing to do with reinstalling xl95

You don't need any libraries beyond VBA to sue the Shell command.

You said nothing happens. In my test:

Sub Tester9()
XX = Shell("start myfile.yyy", 2)
MsgBox XX

End Sub

Msgbox comes up with a number, but no application is started. I don't know
if that is what you are getting. (there is no application associated with
..yyy).

When multiple copies of Excel are installed, it is recommended by microsoft
that they be installed from oldest to newest. I can't tell you whether it
would be problematic to reinstall xl95, but I don't see any reason to do it.
 
Tom Ogilvy said:
If Range("VersionNo").Value < 8 Then 'Excel version number
Exit Sub
Else

Would require that you have an application associated with the extension of
your file spec in Range("URL")

If not, then start wouldn't know what application to start. If that is the
case, it has nothing to do with reinstalling xl95

You don't need any libraries beyond VBA to sue the Shell command.

You said nothing happens. In my test:

Sub Tester9()
XX = Shell("start myfile.yyy", 2)
MsgBox XX

End Sub

Msgbox comes up with a number, but no application is started. I don't know
if that is what you are getting. (there is no application associated with
.yyy).

When multiple copies of Excel are installed, it is recommended by microsoft
that they be installed from oldest to newest. I can't tell you whether it
would be problematic to reinstall xl95, but I don't see any reason to do it.

Tom thanks -
XX = Shell("start " & Range("URL").Value, 2)

Range("URL").value reads C:\Data\Htm\Chapter4Text.htm, and it all
fires up just fine with that code on Machine A so either we are
missing a library reference, or the XL95 installation is corrupted,
hnce my suggestion of reinstalling. But please could you let us
whether the above *code* looks OK ? and if not what extra should it
contain ?

Thanks Charles
 
Tom Ogilvy said:
If Range("VersionNo").Value < 8 Then 'Excel version number
Exit Sub
Else

Would require that you have an application associated with the extension of
your file spec in Range("URL")

If not, then start wouldn't know what application to start. If that is the
case, it has nothing to do with reinstalling xl95

You don't need any libraries beyond VBA to sue the Shell command.

You said nothing happens. In my test:

Sub Tester9()
XX = Shell("start myfile.yyy", 2)
MsgBox XX

End Sub

Msgbox comes up with a number, but no application is started. I don't know
if that is what you are getting. (there is no application associated with
.yyy).

When multiple copies of Excel are installed, it is recommended by microsoft
that they be installed from oldest to newest. I can't tell you whether it
would be problematic to reinstall xl95, but I don't see any reason to do it.

Tom thanks -
XX = Shell("start " & Range("URL").Value, 2)

Range("URL").value reads C:\Data\Htm\Chapter4Text.htm, and it all
fires up just fine with that code on Machine A so either we are
missing a library reference, or the XL95 installation is corrupted,
hnce my suggestion of reinstalling. But please could you let us
whether the above *code* looks OK ? and if not what extra should it
contain ?

Thanks Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top