eNerGiZer0101
July 7th, 2004, 08:06 AM
G'day to all,
Here is the line that gave me an error:
FileSys.CopyFile X1template,NewX1sFileName
Does anyone have any ideas insolving this error.
Heres is a little more about:
Sub CreateExcel
' Creating Ms-Excel daily report and opening the workbook
If FileSys.FileExists(NewXlsFileName) Then
if silent then
FileSys.DeleteFile
NewXlsFileName,true
FileSys.CopyFile
XlTemplate,NewXlsFileName
Else
prompt = NewXlsFileName & "
already exists." & vbcrlf & "Do you want to overwrite
that file?"
title = "Ms-Excel Report file
exists"
buttons = 3
answer=MsgBox
(Prompt,buttons,title)
Select Case answer
Case 2
Wscript.Quit
Case 6
FileSys.CopyFile
XlTemplate,NewXlsFileName,True
'FileSys.DeleteFile NewXlsFileName,True
Case 7
NewXlsFileName =
inputbox("Enter the new file name.","Input Name
File",DefaultXlsFN)
Do While
fileSys.FileExists(newfn)
NewXlsFileName = inputbox(newfn & "already
exists." & vbcrlf & "Enter the new file name.(Empty to
quit)","Input Name File",DefaultXlsFN)
If
NewXlsFileName = "" Then wscript.quit
Loop
FileSys.CopyFile
XlTemplate,NewXlsFileName
End Select
End If
msgbox NewX1sFileName
Else
FileSys.CopyFile XlTemplate,NewXlsFileName
End If
'Opening the Newly copied Excel Spreadsheet
oXL.Workbooks.open NewXlsFileName
'Deleting resume.xlw file which prevent popup
when saving the file
if FileSys.FileExists (oXL.DefaultFilePath
& "\Resume.xlw") then
Filesys.deleteFile oXL.DefaultFilePath
& "\Resume.xlw",true
End If
if silent then
oXL.Visible = False
Else
oXL.Visible = True
Wscript.Echo "Ms-Excel will be minimized
during the report creation so you can continue working on
other things." & vbcrlf & "Once done, it will be
maximized."
oXL.WindowState = xlMinimized
End If
End Sub
Thanks to all.
William
Here is the line that gave me an error:
FileSys.CopyFile X1template,NewX1sFileName
Does anyone have any ideas insolving this error.
Heres is a little more about:
Sub CreateExcel
' Creating Ms-Excel daily report and opening the workbook
If FileSys.FileExists(NewXlsFileName) Then
if silent then
FileSys.DeleteFile
NewXlsFileName,true
FileSys.CopyFile
XlTemplate,NewXlsFileName
Else
prompt = NewXlsFileName & "
already exists." & vbcrlf & "Do you want to overwrite
that file?"
title = "Ms-Excel Report file
exists"
buttons = 3
answer=MsgBox
(Prompt,buttons,title)
Select Case answer
Case 2
Wscript.Quit
Case 6
FileSys.CopyFile
XlTemplate,NewXlsFileName,True
'FileSys.DeleteFile NewXlsFileName,True
Case 7
NewXlsFileName =
inputbox("Enter the new file name.","Input Name
File",DefaultXlsFN)
Do While
fileSys.FileExists(newfn)
NewXlsFileName = inputbox(newfn & "already
exists." & vbcrlf & "Enter the new file name.(Empty to
quit)","Input Name File",DefaultXlsFN)
If
NewXlsFileName = "" Then wscript.quit
Loop
FileSys.CopyFile
XlTemplate,NewXlsFileName
End Select
End If
msgbox NewX1sFileName
Else
FileSys.CopyFile XlTemplate,NewXlsFileName
End If
'Opening the Newly copied Excel Spreadsheet
oXL.Workbooks.open NewXlsFileName
'Deleting resume.xlw file which prevent popup
when saving the file
if FileSys.FileExists (oXL.DefaultFilePath
& "\Resume.xlw") then
Filesys.deleteFile oXL.DefaultFilePath
& "\Resume.xlw",true
End If
if silent then
oXL.Visible = False
Else
oXL.Visible = True
Wscript.Echo "Ms-Excel will be minimized
during the report creation so you can continue working on
other things." & vbcrlf & "Once done, it will be
maximized."
oXL.WindowState = xlMinimized
End If
End Sub
Thanks to all.
William