明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 949|回复: 0

CAD中打开excel问题

[复制链接]
发表于 2016-11-3 20:49 | 显示全部楼层 |阅读模式
代码运行的时候出现了





代码如下:
Sub 拱坝平面布置图()

Dim Path As String
Dim Hight, Z_cord, Tc, TaL, TaR As Double '定义拱圈厚度
Dim RcL, RcR, TgL, TgR As Double '定义拱圈半径,角度
Dim LastRow As Long
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dim xlapp As Excel.Application
Dim xlbook As Excel.workbook
Dim xlsheet As Excel.worksheet
On Error GoTo ErrMsg
Set xlapp = CreateObject("excel.application")

   Path = xlapp.GetOpenFilename("Microsoft Office Excel 文件(*.xls),*.xls", , "选择文件")
     If Path = "False" Then
       MsgBox ("Nothing")
       End
     End If

Set xlbook = xlapp.workbooks.Open(Path) '打开的EXCEL路径
Set xlsheet = xlbook.worksheets("参数") '打开EXCEL中的工作表

ErrMsg:
xlbook.Close
xlapp.Quit
Set xlapp = Nothing

End Sub


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-19 11:19 , Processed in 0.471940 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表