Hi.
Can someone help me with this script?
Why it doesn't run?
Thanks in advanced
<html>
<head>
</head>
<body>
<script type="text/vbscript">
‘Creating a new Excel file from an existing Excel Sheet
Function CopySheet (SourceFile, SheetName, DestinationFile)
Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible = True
objExcel.DisplayAlerts = True
Set objWorkbook1= objExcel.Workbooks.Open(c:\SourceFile.xlsm)
Set objWorkbook2= objExcel.Workbooks.Add()
objWorkbook1.Worksheets(SheetName).UsedRange.Copy
objWorkbook2.Worksheets(“Sheet1).Range(“A1).PasteSpecial Paste =xlValues
objWorkbook2.Worksheets(“Sheet1).Name = ”Global”
objWorkbook2.saveAs(c:\DestinationFile.xlsm)
objWorkbook1.close
objWorkbook2.close
set objExcel=nothing
End Function
</script>
</body>
</html>