Excel not closing after vbscript finish looking for Data value
Hello,
Need some help please, excel app stay open after being run.
Thank You!
WHAT_TO_FIND = Format.NamedSubStrings("Lot#").Value
File_Path = "C:\BarTender\TableList.xlsx"
Set oExcel = CreateObject("Excel.Application")
Set oData = oExcel.Workbooks.Open(File_Path)
Set FoundCell = oData.Worksheets("info").Range("A2:A1500").Find(WHAT_TO_FIND)
row = FoundCell.Row
col = FoundCell.ColumnValue = oData.Worksheets("info").Cells(row,col+10)
oExcel.Quit
-
Peter Thane
★ BarTender Hero ★
Is there any reason you are using VB and not creating a Database Connection to achieve this?
My guess would be that Excel is doing the usual and asking if you want to save it or not when you try to close it and so may need to include something in your script for this.
0 -
Pascal Lacasse
★ BarTender Hero ★
DB is already been used to grab other data.
I try out different way, save and close. Still not working.
Set FoundCell = Nothing
oData.Close False
Set oData = Nothing
oExcel.Quit
Set oExcel = NothingFor now, after script is executed, we kill Excel in task manager using VBScript.
0 -
Peter Thane
★ BarTender Hero ★
Not sure if this helps, going back to the old Quit command
0
Please sign in to leave a comment.
Comments
3 comments