Micro Focus QTP (UFT) Forums

Full Version: Closing a specific Excel file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a easy way to close a specific Excel file? I can close all of them, I just cant seem to close one file.

thx everyone ;-)
Try this:

Code:
Set excel=CreateObject("Excel.Application")
excel.visible=true
set obj_excel=excel.workbook.open(<Enter the path for ur excel file>)
like this u can open many excel files but use the reference to close any particular file.
obj_excel.close()

Correct me if wrong.

Regards,
Sankalp
Sankalp.

Thx, I guess In was just tired. Was up since 1:30am with a Prod issue. Thx, i am clear now.

Lor