[AccessD] Run Excel From Within Access

Arthur Fuller fuller.artful at gmail.com
Sat May 26 21:28:29 CDT 2012


Thanks, Stuart! ShellExecute worked like a charm.
A.

On Sat, May 26, 2012 at 10:13 PM, Stuart McLachlan
<stuart at lexacorp.com.pg>wrote:

> You need to quote the program path because it has spaces in it.
>
>  Application.RunQQ( "C:\Program Files (x86)\Microsoft
> Office\Office11\Excel.exe") & " "  & strFile
>
> Alternatively, use ShellExecute() and you don't need to worry about the
> path to Excel on the
> machine you are running on.
>
>
> Public 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
>
> ...
> ShellExecute Application.hWndAccessApp, "Open", strFile, "", "",
> vbNormalFocus
>
>
> --
> Stuart
>
>
>


More information about the AccessD mailing list