Re: Start HTA from VBA with param by Albert
Albert
Tue Jul 20 15:58:30 CDT 2004
Hi Tom,
The first solution works fine when I use the windows path (not %windir%). I
think I should be able to read this from a registry key.
Thanks!
Albert Jan
"Tom Lavedas" <tlavedas@hotmail.remove.com> wrote in message
news:A624082E-EC17-4013-BF14-83AA6DB9BE29@microsoft.com...
> IE is not the host application for HTAs. It's mshta.exe in the
%windir%\system32 folder. Try explicitily invoking it to see if that helps
(do know, just a guess) ...
>
> AppName="""C:\Program Files\BMBConnect\BMBConnect.hta"" -748172"
> x = Shell("%windir%\system32\mshta.exe " & AppName)
>
> If that doesn't work, try creating a temporary shortcut using the
Wscript.Shortcut object. The TargetPath property of the shortcut will be
"%windir%\system32\mshta.exe" and the HTA and its parameter go in the
Arguments property. Then use the Shell() to execute the shortcut.
>
> Tom Lavedas
> ===========
>
> "Albert Jan" wrote:
>
> > Hi,
> >
> > this should be simple: I want to start a hypertext application from VBA
(I
> > know; not vbs: in this case I use MSAcccess). The hypertext application
uses
> > a parameter, so from the commandline this works fine:
> >
> > "C:\Program Files\BMBConnect\BMBConnect.hta" -748172
> >
> > But I'm unable to start this from script. It should be something like
this
> >
> > AppName="""C:\Program Files\BMBConnect\BMBConnect.hta"" -748172"
> > X = Shell(AppName, 1)
> >
> > When I try to open IE with this HTA the whitespace after 'hta' is
encoded,
> > and I get the message that the hta file cannot be found.
> >
> > How can I do this?
> >
> > Thanks,
> >
> > Albert Jan
> >
> >
> >
> >