confirmation of file before opening spreadsheet
Hi,
This is a modification of Tom Olgive's code found by searching the Google
group.
If the workbook is not open it will open it and then activate your
spreadsheet.
You need to change some info to suit your needs.
Sub chectforworkbook()
Dim wkbk As Workbook
Dim sName As String
sName = "Integrity.xls"
On Error Resume Next
Set wkbk = Workbooks(sName)
On Error GoTo 0
If wkbk Is Nothing Then
Set wkbk = Workbooks.Open(sName)
Windows("Book2").Activate
End If
End Sub
"phil" wrote in message
...
I want to write code in the Worksheet so that when users open the
spreadsheet it looks for and confirms that a file with a certain name
exists in the Windows directory. Otherwise it closes the spreadsheet.
Does anyone know how to do this?
your help will be appreciated
phil in da uk
|