rsview32VBA一次风机房报表.doc_第1页
rsview32VBA一次风机房报表.doc_第2页
rsview32VBA一次风机房报表.doc_第3页
rsview32VBA一次风机房报表.doc_第4页
rsview32VBA一次风机房报表.doc_第5页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Sub MyReportExcel() Dim xlsFile_ban As String Dim objexcel As Object Dim myRow As Integer Dim myCol As Integer Dim rdCount As Integer Dim xlsFilePath As String On Error Resume Next If Right(gTagDb(reportfilepath).Value, 1) = Then xlsFilePath = gTagDb(reportfilepath).Value Else xlsFilePath = gTagDb(reportfilepath).Value & End If xlsFile_ban = gProject.Path + vbareport.xls presentDate = gTagDb(systemyear).Value & - & gTagDb(systemmonth).Value & - & gTagDb(systemdayofmonth).Value myXlsFile = xlsFilePath & Format(Year(presentDate), 0000) & Format(Month(presentDate), 00) & Format(Day(presentDate), 00) & .xls myresult = VBA.Dir(myXlsFile) If myresult = Then VBA.FileCopy xlsFile_ban, myXlsFile gTagDb(reportcurrent).Value = 1 End If Set objexcel = CreateObject(Excel.Application) objexcel.Workbooks.Open (myXlsFile) objexcel.Worksheets(presentBanci + 1).Activate myRow = 5 objexcel.Cells(2, 30).Value = presentDate While (objexcel.Cells(myRow, 1).Value ) myRow = myRow + 1 Wend objexcel.Application.Visible = True With objexcel .Cells(myRow, 1).Value = myRow - 4 序号 .Cells(myRow, 2).Value = gTagDb(systemtime).Value 时间 .Cells(myRow, 3).Value = gTagDb(reportO_BEFORE).Value 柜前氧含量 .Cells(myRow, 4).Value = gTagDb(reportO_AFTER).Value 柜后氧含量 .Cells(myRow, 5).Value = gTagDb(reportAT_0501_1).Value 风机出口总管烟气氧含量 .Cells(myRow, 6).Value = gTagDb(reportAT_0501_2).Value 风机出口总管烟气CO含量 .Cells(myRow, 7).Value = gTagDb(reportAT_0506).Value 风机入口总管烟气粉尘含量 .Cells(myRow, 8).Value = gTagDb(reportF1).Value 供水总管流量 .Cells(myRow, 9).Value = gTagDb(reportF2).Value 一文喷淋供水流量 .Cells(myRow, 10).Value = gTagDb(reportF3).Value 二文喷淋供水流量 .Cells(myRow, 11).Value = gTagDb(reportFI).Value 风机入口总管烟气流量 .Cells(myRow, 12).Value = gTagDb(reportFI_GASOUT).Value 柜出口煤气流量(瞬时值) .Cells(myRow, 13).Value = gTagDb(reportFQ_GASOUT).Value 柜出口煤气流量(累积值) .Cells(myRow, 14).Value = gTagDb(reportP1).Value 一文喷淋水压力 .Cells(myRow, 15).Value = gTagDb(reportP2).Value 二文喷淋水压力 .Cells(myRow, 16).Value = gTagDb(reportPT_1501).Value 1#风机入口烟气压力 .Cells(myRow, 17).Value = gTagDb(reportPT_1502).Value 1#风机出口烟气压力 .Cells(myRow, 18).Value = gTagDb(reportPT_2501).Value 2#风机入口烟气压力 .Cells(myRow, 19).Value = gTagDb(reportPT_2502).Value 2#风机出口烟气压力 .Cells(myRow, 20).Value = gTagDb(reportP).Value 柜内煤气压力 .Cells(myRow, 21).Value = gTagDb(reportPd1).Value 转炉罩口微差压 .Cells(myRow, 22).Value = gTagDb(reportPd2).Value 一文进出口差压 .Cells(myRow, 23).Value = gTagDb(reportPd3).Value 脱水器进出口差压 .Cells(myRow, 24).Value = gTagDb(reportPd4).Value 二文进出口差压 .Cells(myRow, 25).Value = gTagDb(reportPd5).Value 90脱水器进出口差压 .Cells(myRow, 26).Value = gTagDb(reportPd6).Value 脱水塔进出口差压 .Cells(myRow, 27).Value = gTagDb(reportT1).Value 一文进口烟气温度 .Cells(myRow, 28).Value = gTagDb(reportT2).Value 一文出口烟气温度 .Cells(myRow, 29).Value = gTagDb(reportT3).Value 二文出口烟气温度 .Cells(myRow, 30).Value = gTagDb(reportLE).Value 柜位 .Cells(myRow, 31).Value = gTagDb(reportV).Value 柜容 End With objexcel.ActiveWorkbook.Save objexcel.ActiveWorkbook.Saved = True objexcel.Workbooks.Close objexcel.Quit Set objexcel = Nothing gTagDb(reportcurrent).Value = gTagDb(reportcurrent).Value + 1 End SubSub myquit() On Error Resume NextIf LCase(gTagDb(systemuser).Value) default ThenIf MsgBox(确认要退出?, vbOKCancel + vbQuestion, 提示) = vbOK ThengCommand.Execute (projectstop)End IfElseMsgBox 对不起,你没有退出的权限!, vbOKOnly + vbCritical, 错误End IfEnd SubSub MySearch1() Dim xlsFile_ban, SearchDate, SearchBanci, Searchbancitemp, SearchXlsFile, myresult As String Dim objexcel As Object Dim myRow As Integer Dim myCol As Integer Dim rdCount As Integer Dim xlsFilePath As String On Error GoTo laberr If Right(gTagDb(reportfilepath).Value, 1) = Then xlsFilePath = gTagDb(reportfilepath).Value Else xlsFilePath = gTagDb(reportfilepath).Value & End If SearchxlsFile_ban = gProject.Path + vbareport.xls SearchDate = gTagDb(reportSearchyear).Value & - & gTagDb(reportSearchmonth).Value & - & gTagDb(reportSearchday).Value SearchXlsFile = xlsFilePath & Format(Year(SearchDate), 0000) & Format(Month(SearchDate), 00) & Format(Day(SearchDate), 00) & .xls myresult = VBA.Dir(SearchXlsFile) If myresult Then Set objexcel = CreateObject(Excel.Application) objexcel.Workbooks.Open SearchXlsFile, , True objexcel.Worksheets(presentBanci + 1).Activate objexcel.Application.Visible = True Else MsgBox 没有 & SearchDate & 的记录, vbOKOnly, 提示 End If laberr: If Err.Number 0 Then MsgBox 错误 & Err.Number & : & Err.Description & ,错误源: & IIf(Err.Source = , 无, Err.Source) & 。, vbCritical, 错误 End IfEnd SubSub SearchDayIni() On Error Resume NextgTagDb(reportSearchYear).Value = gTagDb(systemYear).ValuegTagDb(reportSearchMonth).Value = gTagDb(systemMonth).ValuegTagDb(reportSearchDay).Value = gTagDb(systemDayofMonth).ValueEnd SubSub SaveFilePath() On Error Resume NextIf LCase(gTagDb(systemuser).Value) default ThengTagDb(reportfilepath).InitialValue = gTagDb(reportfilepath).ValuegTagDb(reportfilepath).WriteConfigurationElseMsgBox 对不起,你没有权限!, vbOKOnly + vbCritical, 错误End IfEnd SubSub MyPrint1() Dim xlsFile_ban, SearchDate, SearchBanci, Searchbancitemp, SearchXlsFile, myresult As String Dim objexcel As Object Dim myRow As Integer Dim myCol As Integer Dim rdCount As Integer Dim xlsFilePath As String On Error GoTo laberr If Right(gTagDb(reportfilepath).Value, 1) = Then xlsFilePath = gTagDb(reportfilepath).Value Else xlsFilePath = gTagDb(reportfilepath).Value & End If SearchxlsFile_ban = gProject.Path + vbareport.xls SearchDate = gTagDb(reportSearchyear).Value & - & gTagDb(reportSearchmonth).Value & - & gTagDb(reportSearchday).Value SearchBanci = gTagDb(reportSearchshift).Value SearchXlsFile = xlsFilePath & Year(SearchDate) & Month(SearchDate) & Day(SearchDate) & .xls myresult = VBA.Dir(SearchXlsFile) If myresult Then Set objexcel = CreateObject(Excel.Application) objexcel.Workbooks.Open SearchXlsFile, , True objexcel.Worksheets

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论