Hi,
I need to check if a workbook is already open and am struggling with the correct code. I think i'm almost there, see below, however it comes up with an error when trying to set the workbook.
Any helo will be much appreciated.
Thanks in advance
Blunder
I need to check if a workbook is already open and am struggling with the correct code. I think i'm almost there, see below, however it comes up with an error when trying to set the workbook.
Code:
Sub Raw_Data()
Dim Iptbox As Excel.Range
Dim wbook As Workbook
Set Iptbox = Application.InputBox(Prompt:="Highlight cell to open raw data", Title:="Date for Raw Data", Type:=8)
Range("iv1").Formula = CDate(Iptbox)
Set wbook = Workbooks("Fail stats COB" & Format(Iptbox, "mmdd") & ".xls")
If Not wbook Is Nothing Then
Workbooks.Open Filename:= _
"V:\Daily Raw Data\" & Format(Range("iv1").Value, "yyyy""\""mmmm""\Wipro Fail stats COB ""ddmm"), IgnoreReadOnlyRecommended:=True
End If
End Sub
Any helo will be much appreciated.
Thanks in advance
Blunder