Micro Focus QTP (UFT) Forums
Closing a specific Excel file - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Closing a specific Excel file (/Thread-Closing-a-specific-Excel-file)



Closing a specific Excel file - mv8167 - 08-19-2011

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 ;-)


RE: Closing a specific Excel file - sshukla12 - 08-19-2011

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


RE: Closing a specific Excel file - mv8167 - 08-19-2011

Sankalp.

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

Lor