ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Shell command stopped working: is it part of Excel 95 , or Windows? (https://www.excelbanter.com/excel-programming/296602-shell-command-stopped-working-part-excel-95-windows.html)

Charles Jordan

Shell command stopped working: is it part of Excel 95 , or Windows?
 
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

Chris

Shell command stopped working: is it part of Excel 95 , or Windows?
 
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


Tom Ogilvy

Shell command stopped working: is it part of Excel 95 , or Windows?
 
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.
--
Regards,
Tom Ogilvy

"Charles Jordan" wrote in message
om...
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




Chris

Shell command stopped working: is it part of Excel 95 , or Windows?
 
I was referring to the Microsoft Shell Controls and Automation

Tom Ogilvy

Shell command stopped working: is it part of Excel 95 , or Windows?
 
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.

--
Regards,
Tom Ogilvy

"chris" wrote in message
...
I was referring to the Microsoft Shell Controls and Automation




Charles Jordan

Shell command stopped working: is it part of Excel 95 , or Windows?
 
"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
'-----------------------------------

Charles Jordan

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

Tom Ogilvy

Shell command stopped working: is it part of Excel 95 , or Windows?
 
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.

--
Regards,
Tom Ogilvy



"Charles Jordan" wrote in message
om...
(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




Charles Jordan

Shell command stopped working: is it part of Excel 95 , or Windows?
 
"Tom Ogilvy" wrote in message ...
If Range("VersionNo").Value < 8 Then 'Excel version number
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.

--
Regards,
Tom Ogilvy


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







"Charles Jordan" wrote in message
om...
(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


Charles Jordan

Shell command stopped working: is it part of Excel 95 , or Windows?
 
"Tom Ogilvy" wrote in message ...
If Range("VersionNo").Value < 8 Then 'Excel version number
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.

--
Regards,
Tom Ogilvy


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







"Charles Jordan" wrote in message
om...
(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



All times are GMT +1. The time now is 08:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com