Micro Focus QTP (UFT) Forums
working with excel - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: working with excel (/Thread-working-with-excel)



working with excel - ch_rk2004 - 10-20-2014

Hi all,

My application creates an excel file and saves it in temp folder with a name including machine name (the name system on which the script is executed).

The requirement is, i need open that excel file and save it at particular location irrespective of the machine on which it is executed.
how can i handle this ...?


RE: working with excel - supputuri - 10-21-2014

you can get the computer name using the below code
Code:
Set WshNetwork = CreateObject("WScript.Network")
ComputerName = WshNetwork.ComputerName
Then from there you can take it forward I guess let me know if you need any more help


RE: working with excel - ch_rk2004 - 09-23-2015

can u pl help on further steps..from the code given we can get the machine name, but how can i copy the file to new location....


RE: working with excel - supputuri - 09-25-2015

Use the File system object and copyfile or copy methods to copy the file into new location.

To get the temp path use Envrionment("SystemTempDir")

Let me know if you need the snippet.