Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Problem opening .htm file from Excel 2000

Hi. I am having a problem, I think in migrating an application which
is successful on one PC (PC "A", running Windows ME) to another PC
("B" running Windows XP).

(1) On PC "A" we have developed an Excel 2000 file which in all
respects works fine. In particular, as a menu option, it will open an
..htm help file that I wrote and saved in Word 2000 (of about 100 kb).

(2) I then wrote an install programme in VBA which successfully
creates a folder hierarchy on "B" , and copies .xls, .gif, .xla files
from a CD, all installed in the correct places. In all cases I used
Easy CD creator to copy the files to the CD. The install programme
programme on the CD, "Setup.xls" , then copies all the files.

(3) On PC "B", the workbook fires up just fine, but when we press the
help file menu option, it fails to start up Internet Explorer, and
thus present the Help file. The 2 lines of code in question a-

..URL = "C:\Data\Htm\Chapter1text.htm"
X = Shell("start " & URL, 2)

Given that this code works fine on PC "A", and not on "B", it makes me
think that some files or links are not getting copied from "A" onto
the CD, so that the Shell command is failing. Or does Shell not work
in Windows XP ?

On PC "B", the file list appears to be exactly the same, and in the
same folders as on "A" and includes:-

Header.htm
filelist.xml
and many image.gif files (about 40).

It it therefore possible to move this application simply by copying
fles with Easy CD Creator, as I have done ?


Thanks in advance - I have a large number of students due to get the
whole install in about 10 days time ! Charles Jordan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Problem opening .htm file from Excel 2000

Hi Charles,

Shelling a "start" command doesn't work on my system (XP), but I haven't
used it much, so there may be a way to get it to work. Alternatively, you
could use the ShellExecute API call to do this:

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Sub test()
Dim URL As String
Dim x As Long

URL = "C:\Data\Htm\Chapter1text.htm"
x = ShellExecute(0, vbNullString, URL, _
vbNullString, "C:\Data\Htm", 1)
End Sub

This method should work on all Win32 systems. You can check the return code
to see if it was successful.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Charles Jordan wrote:
Hi. I am having a problem, I think in migrating an application which
is successful on one PC (PC "A", running Windows ME) to another PC
("B" running Windows XP).

(1) On PC "A" we have developed an Excel 2000 file which in all
respects works fine. In particular, as a menu option, it will open an
.htm help file that I wrote and saved in Word 2000 (of about 100 kb).

(2) I then wrote an install programme in VBA which successfully
creates a folder hierarchy on "B" , and copies .xls, .gif, .xla files
from a CD, all installed in the correct places. In all cases I used
Easy CD creator to copy the files to the CD. The install programme
programme on the CD, "Setup.xls" , then copies all the files.

(3) On PC "B", the workbook fires up just fine, but when we press the
help file menu option, it fails to start up Internet Explorer, and
thus present the Help file. The 2 lines of code in question a-

.URL = "C:\Data\Htm\Chapter1text.htm"
X = Shell("start " & URL, 2)

Given that this code works fine on PC "A", and not on "B", it makes me
think that some files or links are not getting copied from "A" onto
the CD, so that the Shell command is failing. Or does Shell not work
in Windows XP ?

On PC "B", the file list appears to be exactly the same, and in the
same folders as on "A" and includes:-

Header.htm
filelist.xml
and many image.gif files (about 40).

It it therefore possible to move this application simply by copying
fles with Easy CD Creator, as I have done ?


Thanks in advance - I have a large number of students due to get the
whole install in about 10 days time ! Charles Jordan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Problem opening .htm file from Excel 2000

"Jake Marx" wrote in message ...
Hi Charles,

Shelling a "start" command doesn't work on my system (XP), but I haven't
used it much, so there may be a way to get it to work. Alternatively, you
could use the ShellExecute API call to do this:

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Sub test()
Dim URL As String
Dim x As Long

URL = "C:\Data\Htm\Chapter1text.htm"
x = ShellExecute(0, vbNullString, URL, _
vbNullString, "C:\Data\Htm", 1)
End Sub

This method should work on all Win32 systems. You can check the return code
to see if it was successful.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Charles Jordan wrote:
Hi. I am having a problem, I think in migrating an application which
is successful on one PC (PC "A", running Windows ME) to another PC
("B" running Windows XP).

(1) On PC "A" we have developed an Excel 2000 file which in all
respects works fine. In particular, as a menu option, it will open an
.htm help file that I wrote and saved in Word 2000 (of about 100 kb).

(2) I then wrote an install programme in VBA which successfully
creates a folder hierarchy on "B" , and copies .xls, .gif, .xla files
from a CD, all installed in the correct places. In all cases I used
Easy CD creator to copy the files to the CD. The install programme
programme on the CD, "Setup.xls" , then copies all the files.

(3) On PC "B", the workbook fires up just fine, but when we press the
help file menu option, it fails to start up Internet Explorer, and
thus present the Help file. The 2 lines of code in question a-

.URL = "C:\Data\Htm\Chapter1text.htm"
X = Shell("start " & URL, 2)

Given that this code works fine on PC "A", and not on "B", it makes me
think that some files or links are not getting copied from "A" onto
the CD, so that the Shell command is failing. Or does Shell not work
in Windows XP ?

On PC "B", the file list appears to be exactly the same, and in the
same folders as on "A" and includes:-

Header.htm
filelist.xml
and many image.gif files (about 40).

It it therefore possible to move this application simply by copying
fles with Easy CD Creator, as I have done ?


Thanks in advance - I have a large number of students due to get the
whole install in about 10 days time ! Charles Jordan


Jake - thanks. Hope you had a great Thanksgiving. Your fix worked
brilliantly first time!. But please what is, and how do I "check the
return code" ??
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Problem opening .htm file from Excel 2000

Hi Charles,

Jake - thanks. Hope you had a great Thanksgiving. Your fix worked
brilliantly first time!. But please what is, and how do I "check the
return code" ??


Yes I did - ate way too much. Hope you had a great Thanksgiving, too.

In this case, the return code is the value that will be assigned to the
variable x. There are many constants declared in the Windows API that you
can compare this return code with.

Here's a link to the MSDN description of ShellExecute:

http://msdn.microsoft.com/library/en...ellexecute.asp

A VB example is he

http://www.mvps.org/access/api/api0018.htm

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2000 file in use when opening xls file htrajt Excel Discussion (Misc queries) 3 February 12th 08 12:55 PM
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 gromit12 Excel Discussion (Misc queries) 2 November 6th 07 09:30 PM
Excel 2000 - Trouble Opening File pbuc0109 Excel Discussion (Misc queries) 1 March 2nd 07 06:20 AM
problem with opening hyperlink in excel 2000 Ruth Links and Linking in Excel 5 March 15th 06 06:06 PM
Excel 2000 shuts down after opening file thunderbird30 Setting up and Configuration of Excel 1 November 12th 05 03:14 PM


All times are GMT +1. The time now is 05:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"