1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Sub RunScript
Set wshNetwork = CreateObject("Wscript.Network")
strAnswer = window.prompt("Please enter the Location to save.", "\\IP\HTA\" & wshNetwork.ComputerName & ".xls")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("\\IP\HTA\" & wshNetwork.ComputerName & ".xls")Then
MsgBox "fichier exist"
Else
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CreateTextFile(strAnswer)
Set objFile = objFSO.OpenTextFile(strAnswer, 2)
objFile.WriteLine Data.InnerHTML
objFile.Close
Msgbox "Sauvegardé."
End if
End Sub |