G
Guest
How can I verify if one specific sheet is inside the spresdsheet?
I need to verify if it exists, otherwise a error message of "Out of range"
appears and it does not make much os a sense to my users.
To open the Excel file I am using:
Dim xlApp As Object
Dim MySheet As Object
Set xlApp = CreateObject("Excel.Application")
Set MySheet = xlApp.WorkBooks.Open(FileName).Sheets(SheetName.Value)
(...)
MySheet.Application.ActiveWorkBook.Close False
xlApp.Quit
Set MySheet = Nothing
Set rstDebit = Nothing
Thanks
I need to verify if it exists, otherwise a error message of "Out of range"
appears and it does not make much os a sense to my users.
To open the Excel file I am using:
Dim xlApp As Object
Dim MySheet As Object
Set xlApp = CreateObject("Excel.Application")
Set MySheet = xlApp.WorkBooks.Open(FileName).Sheets(SheetName.Value)
(...)
MySheet.Application.ActiveWorkBook.Close False
xlApp.Quit
Set MySheet = Nothing
Set rstDebit = Nothing
Thanks