Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 8th, 2007, 07:24 PM
Registered User
 
Join Date: Mar 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default unable to open notepad and command promt

Hi i am trying to open notepad and command promt from access through Shell function. i tried different option but its not opening.

option for notepad.exe

Option 1)

Private Sub doexe_Click()
Dim RetVal
RetVal = Shell("C:\WINNT\NOTEPAD.EXE", 1)
End Sub

Option 2)
Private Sub doexe_Click()
Dim RetVal
RetVal = Shell("NOTEPAD.EXE", 1)
End Sub
Option 3)
Private Sub doexe_Click()
Dim RetVal
RetVal = Shell("C:\WINDOWS\NOTEPAD.EXE", 1)
End Sub

any idea, why its not working.
 
Old March 9th, 2007, 05:37 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
Default

hi ketAccess,

If you remove the full path and just enter "notepad.exe" this should work, as effectivly, using the SHELL command
is the same as clicking Start > Run.

I have tested the following:
Code:
Dim RetVal As Double
RetVal = Shell("notepad.exe", vbNormalFocus)
Which is your "Option 2" and this worked fine. Are you being given an error message?

Best Regards,
Rob







Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open ProjectTimeTracker DB cancer2006 BOOK: Beginning VB.NET Databases 2 October 24th, 2006 03:53 PM
Unable to open script file Pickle Dreamweaver (all versions) 1 October 31st, 2005 02:35 PM
unable to open flv file sentme_mail Flash (all versions) 0 December 27th, 2004 06:50 AM
Open Notepad from within an HTML page? larry Javascript How-To 2 April 26th, 2004 10:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.