VB6.0引用EXcel2007提示“实时错误48,加载DLL错误”代码如下 5

Case"1#/2#主机供回水温度"'日报时间strDay=Format(Me.dtpDay.Value,"yyyy-m-d")'实例化ADOSetcnADO=NewAD... Case "1#/2#主机供回水温度"' 日报时间 strDay = Format(Me.dtpDay.Value, "yyyy-m-d")' 实例化ADO Set cnADO = New ADODB.Connection Set rsADO = New ADODB.Recordset' 连接Access cnADO.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\HistData.mdb;User ID=;Password=;" cnADO.Open'执行查询 Sql = "SELECT * FROM WD1 " & _ " WHERE HTDate >= #" & strDay & "# AND HTDate <= #" & DateAdd("d", 1, strDay) & "#" & _ " ORDER BY HTDate,HTTime" rsADO.CursorLocation = adUseClient rsADO.Open Sql, cnADO, adOpenDynamic, adLockReadOnly, -1 'adOpenDynamic, adLockUnspecified, -1 If rsADO.RecordCount <= 0 Then MsgBox "无数据!", vbOKOnly + vbInformation, "信息..." Set cnADO = Nothing Set rsADO = Nothing Exit Sub End If Dim xlApp As Excel.Application Dim xlBook As Object Dim xlSheet As Object Dim Temp(1 To 8) As Integer Dim i, j As Integer'Excel打开模板 Set xlApp = New Excel.Application xlApp.DisplayAlerts = False xlApp.Visible = False Set xlBook = xlApp.Workbooks.Open(App.Path & "\1#2#主机供回水温度.xlt") Set xlSheet = xlBook.Worksheets(1) 展开
 我来答
eeeolol
2016-08-26 · TA获得超过8245个赞
知道大有可为答主
回答量:5827
采纳率:15%
帮助的人:689万
展开全部
Set xlApp = New Excel.Application
改为
Set xlApp = createobject("Excel.Application")
试一试
追问
还是不行
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式