You are on page 1of 2

Dim objExcelApp

Set objExcelApp = CreateObject("Excel.Application")

objExcelApp.Visible = True

objExcelApp.Workbooks.Open "D:\NIDEC_COMPANY\SCADA\REPORT_A.xls"

objExcelApp.Cells(2,10).Value = SmartTags("EXPORT_DAY")

objExcelApp.Cells(2,12).Value = SmartTags("EXPORT_MONTH")

objExcelApp.Cells(2,14).Value = SmartTags("EXPORT_YEAR")

objExcelApp.Cells(3,3).Value = SmartTags("EXPORT_0")

objExcelApp.Cells(4,3).Value = SmartTags("EXPORT_1")

objExcelApp.Cells(5,3).Value = SmartTags("EXPORT_2")

objExcelApp.Cells(6,3).Value = SmartTags("EXPORT_3")

objExcelApp.Cells(7,3).Value = SmartTags("EXPORT_4")

objExcelApp.Cells(8,3).Value = SmartTags("EXPORT_5")

objExcelApp.Cells(9,3).Value = SmartTags("EXPORT_6")

objExcelApp.Cells(10,3).Value = SmartTags("EXPORT_7")

objExcelApp.Cells(11,3).Value = SmartTags("EXPORT_8")

objExcelApp.Cells(12,3).Value = SmartTags("EXPORT_9")

objExcelApp.Cells(13,3).Value = SmartTags("EXPORT_10")

objExcelApp.Cells(14,3).Value = SmartTags("EXPORT_11")

objExcelApp.Cells(15,3).Value = SmartTags("EXPORT_12")

objExcelApp.Cells(16,3).Value = SmartTags("EXPORT_13")

objExcelApp.Cells(17,3).Value = SmartTags("EXPORT_14")

objExcelApp.Cells(18,3).Value = SmartTags("EXPORT_15")
objExcelApp.Cells(19,3).Value = SmartTags("EXPORT_16")

objExcelApp.Cells(20,3).Value = SmartTags("EXPORT_17")

objExcelApp.Cells(21,3).Value = SmartTags("EXPORT_18")

objExcelApp.Cells(22,3).Value = SmartTags("EXPORT_19")

objExcelApp.Cells(23,3).Value = SmartTags("EXPORT_20")

objExcelApp.Cells(24,3).Value = SmartTags("EXPORT_21")

objExcelApp.Cells(25,3).Value = SmartTags("EXPORT_22")

objExcelApp.Cells(26,3).Value = SmartTags("EXPORT_23")

objExcelApp.Cells(27,3).Value = SmartTags("EXPORT_2359")

objExcelApp.Sheets("DATA").SaveAs("D:\NIDEC_COMPANY\REPORT_EXCEL\XUONG_A\"&"REPORT_AP_
SUAT_A"&("_")&Day(Date)&("_")&Month(Date)&("_")&Year(Date)&("_")&Hour(Time)&("_")&Minute(Ti
me)&("_")&Second(Time)&".xls")

objExcelApp.Workbooks.Close

objExcelApp.Quit

Set objExcelApp = Nothing

You might also like