Shariq.khan
New Member
- Joined
- Jun 16, 2011
- Messages
- 5
HI! Im Having a problem with this code. I wanna create a new Excel WOrkBook. But I've a problem In the solution Given below:
Sub Test()
x = InputBox("Enter WOrkbook Name")
Dim strDir As String
'// Please Note ""
strDir = "E:Check"
With Application.FileSearch
.LookIn = strDir
.FileName = x
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
'// Please Note ""
Workbooks.Open (strDir & "" & x)
Exit Sub
Else
'// Please Note ""
Workbooks.Add.SaveAs (strDir & "" & x )
ActiveWorkbook.Close
End If
End With
End Sub
Sub Test()
x = InputBox("Enter WOrkbook Name")
Dim strDir As String
'// Please Note ""
strDir = "E:Check"
With Application.FileSearch
.LookIn = strDir
.FileName = x
.FileType = msoFileTypeAllFiles
If .Execute() > 0 Then
'// Please Note ""
Workbooks.Open (strDir & "" & x)
Exit Sub
Else
'// Please Note ""
Workbooks.Add.SaveAs (strDir & "" & x )
ActiveWorkbook.Close
End If
End With
End Sub