-
ok I know how to start it with appactivate but i want it to give me a message saying "please place cd in drive" if it isnt there this is the code i am using:
'It is accessing from a cd rom
myappid=shell (d:\setup.exe, 1)
appactivate myappid
I think that is all I dont have my code with me on this computer. What it does give me is a file not found and I need to debug. I am a newbie I have tried to write a if else statement but i get all kinds of errors. Read message Multiple Access/w Drive Check if you want to know what I was trying to do!! Any Help would be greatly Appreciated!!!
-
Try this:
Code:
Function DiskInDrive() As Boolean
On Error GoTo ErrHan
Dir "D:\", vbDirectory
DiskInDrive = True
Exit Function
ErrHan:
DiskInDrive = False
End Function
Usage
Private Sub Command1_Click()
If DiskInDrive() Then
myappid = Shell("D:\setup.exe", vbNormalFocus)
DoEvents
AppActivate myappid
Else
MsgBox "No CD in drive!"
End If
End Sub