Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Export to Excel Error with file being open
#1
Solved: 12 Years, 10 Months, 2 Weeks ago
I have a test I am running that exports data to Excel. The first time I run the test it creates the file no problem but then when it loops through for the second time it hits this code and errors out saying The DataTable.Export (file) operation failed.
Cannot open the D:\CDC-Automation\Data\Iteration1\Build5_7\Target\Target_Scan_URL.xls file because it is already open in another application.

Function file: D:\CDC-Automation\CDC_QTP_MAIN\Function Libraries\CDC_functions.qfl
Line (694): " datatable.export Target_file".

If instr(url_location,"Source") <> 0 then Source_file=file_dir & "Source_Scan_" & file_name
datatable.export Source_file
elseif instr(url_location,"Target")<> 0 then]
Target_file =file_dir & "Target_Scan_" & file_name Source_file=Replace(Target_file, "Target", "Source") datatable.export Target_file
end if

Any suggestions?
Reply


Messages In This Thread
Export to Excel Error with file being open - by schulerswanie - 07-09-2012, 11:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can we open a password protected zip file using QTP? arunarora1990 2 5,284 07-03-2011, 09:46 AM
Last Post: rajpes

Forum Jump:


Users browsing this thread: 1 Guest(s)