Prev: iexplor is opening with default website when file not found in ms-access
Next: Global Warming and what you can do to against it
From: Naushad on 31 Jan 2010 03:25
I have written a VBA code to open a word file in iexplore by the shell
command. If the file is not found a message is displayed and the
internet explorer is opened.
I want to display the custom message and don't want to open the
iexplore. My code are as follows
Private Sub cmdReport_Click()
On Error GoTo Err_cmdReport_Click
Dim VarPath As String
Dim VarReport As String
Dim varRepDate As Variant
Dim VarCon As String
VarPath = "C:\Documents and Settings\nhaider\Desktop\"
varRepDate = Format$(Me.ReportDate, "dd\-mm\-yy")
VarReport = varRepDate & "@" & Me.Project__ & ".doc"
VarCon = VarPath & VarReport
Shell "C:\Program Files\Internet Explorer\iexplore.exe " &
Please help me to solve this problem.
Thanks in advance
From: Benny Andersen on 31 Jan 2010 04:50
if len(dir(VarCon)) then
From: Naushad on 1 Feb 2010 00:38
On Jan 31, 12:50 pm, Benny Andersen <a.mail.u...(a)gmail.com> wrote:
> if len(dir(VarCon)) then
> shell ....
> msgbox ....
Thank you very much. It is working properly.