Re: Problem passing argument ShellExecute
From: Stefan Merwitz (nospam_at_thisserverdoesntexist.com)
Date: 08/10/04
- Next message: ALESSANDRO Baraldi: "Re: Addressof and VBA"
- Previous message: Stefan Merwitz: "Re: Problem passing argument ShellExecute"
- In reply to: Stefan Merwitz: "Re: Problem passing argument ShellExecute"
- Next in thread: TJ: "Re: Problem passing argument ShellExecute"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 10 Aug 2004 18:45:04 +0200
Oh, there was a mistake!
it must be:
Dim bSuccessFull As Boolean
On Error Resume Next
bSuccessFull = ShellExecute(Me.hwnd, "open", & _
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE", & _
"""C:\Program Files\abc\abc application.mde"" " & _
"/wrkgrp ""C:\ABC\ABC Data\Data\abc workgroupinfofile.mdw""", & _
"" ,1) > 32
Sorry,
Stefan
-- ___________________________________www.VBTricks.de.vu the free resource for Visual Basic, Gambas and Pascal components, tips & complete projects www: http://www.VBTricks.de.vu mail: vbtricks <at> my-mail <dot> ch _____________________________________________________ Stefan Merwitz wrote: > I guess your problem are the long filenames? Shellexecute does accept > long filename's enclosed in "s, too. To use "s in strings, just replace > every occurence of a "s with two "s: > > e.g. > - this is a "test", yes it is --> "this is a ""test"", yes it is" > - this is a "test" --> "this is a ""test""" > - " --> """" > > To execute... > > "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Program > Files\abc\abc application.mde" /wrkgrp "C:\ABC\ABC Data\Data\abc > workgroupinfofile.mdw" > > ...use the following source: > > 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 > > Dim bSuccessFull As Boolean > On Error Resume Next > bSuccessFull = ShellExecute(Me.hwnd, "open", & _ > "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE", & _ > """C:\Program Files\abc\abc application.mde"" " & _ > """/wrkgrp "C:\ABC\ABC Data\Data\abc workgroupinfofile.mdw""", & _ > "" ,1) > 32 > > perhaps you have to set the application path into "s, too (as it also > contains a space char) > > Hope this helps, > > Stefan >
- Next message: ALESSANDRO Baraldi: "Re: Addressof and VBA"
- Previous message: Stefan Merwitz: "Re: Problem passing argument ShellExecute"
- In reply to: Stefan Merwitz: "Re: Problem passing argument ShellExecute"
- Next in thread: TJ: "Re: Problem passing argument ShellExecute"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|