Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2000 file in use when opening xls file | Excel Discussion (Misc queries) | |||
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 | Excel Discussion (Misc queries) | |||
Excel 2000 - Trouble Opening File | Excel Discussion (Misc queries) | |||
problem with opening hyperlink in excel 2000 | Links and Linking in Excel | |||
Excel 2000 shuts down after opening file | Setting up and Configuration of Excel |