- 积分
- 368
- 明经币
- 个
- 注册时间
- 2020-5-25
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 也许有一天 于 2021-3-6 20:38 编辑
Dim xlapp11 As New Excel.Application
Dim xlbook11 As Excel.Workbook
Dim jianche_XlsSheet_1 As Excel.Worksheet
Set xlapp11 = New Excel.Application
With xlapp11.Workbooks.Open(yuan_wenjian & jiancha_name_1 & "评估数据模板.XLSX")
Set xlbook11 = xlapp11.Workbooks.Open(pinggu_wenjian)
Set jianche_XlsSheet_1 = xlbook11.Worksheets(1)
jianche_hang_1 = jianche_XlsSheet_1.Range("A65536").End(xlUp).Row '查A列的上下限界,从列的开始往下查,
Sheets(1).Select ’**第二次这个地方报错**,报错内容为”远程服务器不存在或不能使用“
Range("A4", Cells(jianche_hang_1, 10)).Select
Selection.Copy .Worksheets(1).Range("A2")
Set jianche_XlsSheet_2 = Excel.Application.ActiveWorkbook.Sheets(2)
jianche_hang_2 = jianche_XlsSheet_2.Range("A65536").End(xlUp).Row '查A列的上下限界,从列的开始往下查,
Sheets(2).Select
Range("A3", Cells(jianche_hang_2, 3)).Select 'TQI里程
Selection.Copy .Worksheets(2).Range("A2")
With xlapp11.Workbooks.Open(yuan_wenjian & jiancha_name_1 & "线路信息模板.XLSX")
Set xlbook12 = xlapp11.Workbooks.Open(xianlu_wenjian)
Set jianche_XlsSheet_1 = xlbook12.Worksheets(1)
jianche_hang_1 = jianche_XlsSheet_1.Range("H65536").End(xlUp).Row
Sheets(1).Select
Range("A4", Cells(jianche_hang_1, 12)).Select '复制"线路管界"
Selection.Copy .Worksheets(1).Range("A2")
Set jianche_XlsSheet_2 = Nothing
xlbook12.Close (True)
End With
End With
xlbook11.Close (True)
xlapp11.Quit
Set jianche_XlsSheet_1 = Nothing
Set xlbook11 = Nothing
Set xlapp11 = Nothing
|
|