Hi,
Dim myBook As Excel.Workbook
Dim exObj As Excel.Application
Set myBook = Workbooks.Open(filename:=StrPath)
Set exObj = New Excel.Application
exObj.ActiveWorkbook.Worksheets(cnt + 1).Activate
(some code)
mybook.close
exobj.activeworkbook.close
I have use these stmt to open excel file then using 'exobj' object i have activate particular sheet from workbook.
After that, selected sheet's data is inserted in database.
But i have problem with closing these object.
when application(VB Project) is closed it will display msg as
"excelprj.xls is now enable to read-write"
and that excelsheet is opened.I want to close it.
can you tell me how to close it.
Dim myBook As Excel.Workbook
Dim exObj As Excel.Application
Set myBook = Workbooks.Open(filename:=StrPath)
Set exObj = New Excel.Application
exObj.ActiveWorkbook.Worksheets(cnt + 1).Activate
(some code)
mybook.close
exobj.activeworkbook.close
I have use these stmt to open excel file then using 'exobj' object i have activate particular sheet from workbook.
After that, selected sheet's data is inserted in database.
But i have problem with closing these object.
when application(VB Project) is closed it will display msg as
"excelprj.xls is now enable to read-write"
and that excelsheet is opened.I want to close it.
can you tell me how to close it.