On May 27, 6:47*am, atpgroups wrote:
I have written a Macro which approaches an application in its
complexity. (In retrospect it might have been better as a standalone
application but there are advantages related to portability and
familiarity which mean that Excel is a natural home for it). We have
written a 50 page manual for the Macro.
I would like to embed the help files in the workbook somehow so that
the macro/application can be distributed as a single Excel workbook.
I have tried embedding the help file (in . chm format) in a hidden
worksheet as an OLEobject, and displaying it with
*wsHelp.OLEObjects(fHelp).Show
*and this is partially successful, but unfortunately this triggers a
rash of security warnings, and, more problematically, none of the
links in the embedded help file work.
Is there any way to embed a .chm file in such a way that it remains
functional? or can anyone think of another way to keep the help and
workbook together in one file? (I can display a seperate help file
trivially with
Shell "hh.exe " & ThisWorkBook.Path & "\helpfile.chm"
but I don't really want to trust the users to put the help file in the
right place.
I have put a very simple example file hehttp://www.bodgesoc.org/HelpDemo.xls
This is a single worksheet with a button linked to an embedded version
of the HyperTerminal help file, it demonstrates the broken links
problem quite well.
(As always, use appropriate caution opening linked files from the
internet, but I promise that the linked file is harmless as posted.
Not that a black hat might not hack my website and change it of,
course.)
Why not keep the files seperate and use an installer to place the
files where they are supposed to be? I distribute many Excel Add-Ins
and use InnoSetup, which is free, to handle the installation.
Typically, my add-ins have 3 files: the main add-in file, a .chm help
file, and a .xls file with an Open event to handle the installation of
the add-in.
In the InnoSetup script, I tell the program to launch the
installation .xls file when complete. Then the code in the Open event
of that file installs the add-in. This is the code I use to install
the add-in.
Private Sub Workbook_Open()
Dim wBook As Workbook
On Error Resume Next
Set wBook = Workbooks("your_addin.xla")
start:
'close book if open
If Not wBook Is Nothing Then wBook.Close 'Not open
'uninstall if installed
If AddIns("your_addin").Installed = True Then _
AddIns("your_addin").Installed = False
'install add-in
Set myAddIn = AddIns.Add(FileName:="C:\your_addin\your_addin.XLA ",
_
CopyFile:=True)
AddIns("your_addin").Installed = True
Workbooks("your_addin_Installer.xls").Close
End Sub
Link to InnoSetup:
http://www.jrsoftware.org/isinfo.php
HTH