Results 1 to 2 of 2
Thread: Visual Basic
Hybrid View
-
23rd March 2009 12:55 #1
Visual Basic
, . Visual Basic, / / . 10- , ( ). , worksheet .
.
-
24th March 2009 10:23 #2
VB6 2 .....
. , . .
5.0, 2000.
Code:Set xlObject = CreateObject("Excel.Application") On Error GoTo CreateReportFile Debug.Print (Dir(strFileName, vbDirectory)) If Dir(strFileName, vbDirectory) = "" Then GoTo CreateReportFile Set wbTemplate = xlObject.Workbooks.Open(strFileName) Set shDailyReport = wbTemplate.Sheets("DailyReport") If Minute(Time) = 0 Then If Hour(Time) < 12 Then intLineNumber = Hour(Time) + 16 Else intLineNumber = Hour(Time) + (-8) End If For i = 0 To 9 shDailyReport.Cells(intLineNumber, i + 2).Value = Temp(i) Next i For i = 0 To 7 ppp = sngOldFuel(i) - sngBuffFuel(i) shDailyReport.Cells(intLineNumber, i + 12).Value = ppp sngBuffFuel(i) = sngOldFuel(i) Next i End If For j = 0 To 3 For i = 0 To 5 shDailyReport.Cells(40 + j, i + 3).Value = Label1(12 * j + i).Caption Next i Next j For i = 0 To 7 shDailyReport.Cells(30 + i, 4).Value = intWorkTimeHr(i) & ":" & intWorkTimeMin(i) shDailyReport.Cells(30 + i, 6).Value = intTotalWorkTimeHr(i) '& ":" & intTotalWorkTimeMin(I) shDailyReport.Cells(30 + i, 8).Value = intDayliFuel(i) shDailyReport.Cells(30 + i, 10).Value = intTotalFuel(i) Next i shDailyReport.Cells(41, 9).Value = CLng(dblVolume) shDailyReport.Cells(45, 4).Value = Val(Text1.Text) shDailyReport.Cells(45, 8).Value = Val(Text2.Text) On Error GoTo 0 wbTemplate.Save Set shDailyReport = Nothing Set wbTemplate = Nothing xlObject.Quit Set xlObject = Nothing




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in