Actually, because of the embedded spaces in the paths, you need quotes
around at least the path to msaccess.exe:
stAppName = """C:\Program Files\Microsoft Office\Office\msaccess.exe""" & _
" ""I:\Corporate\Credit\LOTUS\COLLECTI\ACCESS\ddrcath.mdb"""
Call Shell(stAppName, 1)
(The extra quotes around the path to the mdb file aren't strictly necessary,
but there's nothing wrong with including them.)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Paolo" <(E-Mail Removed)> wrote in message
news:5456E1DD-F474-43FE-9DC6-(E-Mail Removed)...
> Hi Juli,
> actually the shell command run an executable program and an mdb isn't.
> If you want to run an mdb with the shell command you must provide the path
> of msaccess.exe followed by the mdb you wanna open.
> assuming msaccess resides in C:\Program Files\Microsoft Office\Office
>
> e.g. stAppName = "C:\Program Files\Microsoft Office\Office\msaccess.exe
> I:\Corporate\Credit\LOTUS\COLLECTI\ACCESS\ddrcath.mdb"
> Call Shell(stAppName, 1)
>
> HTH Paolo
>
> "Juli Intern" wrote:
>
>> Why can't i run application from VB or from Command button? None of these
>> attempts are working:
>>
>> Private Sub Command5_Click()
>> On Error GoTo Err_Command5_Click
>>
>> Dim stAppName As String
>>
>> stAppName = "I:\Corporate\Credit\LOTUS\COLLECTI\ACCESS\ddrcath.mdb"
>> Call Shell(stAppName, 1)
>>
>> Exit_Command5_Click:
>> Exit Sub
>>
>> Err_Command5_Click:
>> MsgBox Err.Description
>> Resume Exit_Command5_Click
>>
>> End Sub
>>
>>
>> or another one:
>> Private Sub runCA_Click()
>>
>> Dim FilePath As String
>>
>> FilePath = "I:\Corporate\Credit\LOTUS\COLLECTI\ACCESS\ddrcath.mdb"
>> Application.FollowHyperlink FilePath
>>
>>
>> End Sub
>>
>> Please, can somebody help? Thank you.
>>