theta
07-05-2012, 04:10 AM
I was playing around with this simple code - but wondered what the convention is for , "CheckDongle" as I have not seen a sub called this way before?
I am now looking at different referencing methods e.g. Range("A1:Z10") (1,3) instead of cells (or using [A1]) as I would like my code to be more efficient.
Any help appreciated
Public Sub CheckDongle()
'check that a file exists, if it doesn't then close Excel, if it does check again in 15 seconds
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists("c:\test.txt") = False Then
Application.Quit
Else
Application.OnTime Now + TimeValue("00:00:15"), "CheckDongle"
End If
Set fs = Nothing
End Sub
I am now looking at different referencing methods e.g. Range("A1:Z10") (1,3) instead of cells (or using [A1]) as I would like my code to be more efficient.
Any help appreciated
Public Sub CheckDongle()
'check that a file exists, if it doesn't then close Excel, if it does check again in 15 seconds
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists("c:\test.txt") = False Then
Application.Quit
Else
Application.OnTime Now + TimeValue("00:00:15"), "CheckDongle"
End If
Set fs = Nothing
End Sub