Call CreateEventIdXls()
Public Function CreateEventIdXls()
Set fs = createObject("Scripting.FilesystemObject")
Environment.Value("FolderPath") = "C:\Documents and Settings\" & Environment.Value("UserName") & "\Desktop\EventId.xls"
If fs.FileExists(Environment.Value("FolderPath")) = False Then
Set ExcelObj = CreateObject("Excel.Application")
ExcelObj.Visible = False
Set ExcelWB = ExcelObj.Workbooks
ExcelWB.Add
'ExcelWB(1).SaveAs Environment.Value("FolderPath") '& "\" &Environment.Value("TestName")
Set ExcelWS = ExcelWB(1).Worksheets
'ExcelWS(1).Activate
'ExcelWS(2).Activate
'ExcelWS(3).Activate
ExcelWS.add
ExcelWS(4).Activate
ExcelWS.add
ExcelWS(5).Activate
ExcelWS.add
ExcelWS(6).Activate
ExcelWS(1).name = "DAY1"
ExcelWS(2).name = "DAY2"
ExcelWS(3).name = "DAY3"
ExcelWS(4).name = "DAY4"
ExcelWS(5).name = "DAY5"
ExcelWS(6).name = "DAY6"
ExcelObj.DisplayAlerts = False
ExcelWB(1).SaveAs Environment.Value("FolderPath") '& "\" &Environment.Value("TestName")
ExcelWS(1).Cells(1, 1).Value = "oUTEventType"
ExcelWS(1).Columns("A:B").AutoFit
ExcelWS(1).Range("A1:B1").Font.Bold = True
ExcelWS(2).Cells(1,1).value ="oUTEventType"
ExcelWS(2).Cells(1,2).value ="oUTEventToBeVerified"
ExcelWS(2).Columns("A:B").AutoFit
ExcelWS(2).Range("A1:B1").Font.Bold = True
ExcelWS(3).Cells(1,1).value ="oUTEventType"
ExcelWS(3).Cells(1,2).value ="oUTEventToBeVerified"
ExcelWS(3).Columns("A:B").AutoFit
ExcelWS(3).Range("A1:B1").Font.Bold = True
ExcelWS(4).Cells(1, 1).Value = "oUTEventType"
ExcelWS(4).Cells(1, 2).Value = "oUTEventToBeVerified"
ExcelWS(4).Columns("A:B").AutoFit
ExcelWS(4).Range("A1:B1").Font.Bold = True
ExcelWB(1).Save
ExcelObj.Quit
Set ExcelWB = Nothing
Set ExcelWS = Nothing
Set ExcelObj = Nothing
End if
End Function
No comments:
Post a Comment