明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2112|回复: 2

哪位大虾给个读取EXCEL数据的模块

[复制链接]
发表于 2003-8-17 09:22:00 | 显示全部楼层 |阅读模式
发表于 2004-8-6 17:06:00 | 显示全部楼层
我也需要这个,可是他们给的下面的这个没用 Private readexcel()
Dim ExcelApp As New Excel.Application
ExcelApp.Workbooks.Open "e:\lhs\cad\zksj.xls", , ReadOnly
Dim pt1(0 To 2) As Double, pt2(0 To 2) As Double
Dim Rad As Double
Dim i As Integer
i = 2
With ExcelApp.ActiveWorkbook.Worksheets("sheet1")
Do
Select Case .Range("c" & i)
Case "直线":
pt1(0) = .Range("c" & i)
pt1(1) = .Range("d" & i)
pt1(2) = 0
pt2(0) = .Range("e" & i)
pt2(1) = .Range("f" & i)
pt2(0) = 0
ThisDrawing.ModelSpace.AddLine pt1, pt2
Case "圆":
pt1(0) = .Range("c" & i)
pt1(1) = .Range("d" & i)
pt1(2) = 0
Rad = .Range("c" & i)
ThisDrawing.ModelSpace.AddCircle pt1, Rad
Case Else:
Exit Do
End Select
i = i + 1
Loop
End With
ExcelApp.Workbooks.Close
ExcelApp.Quit
ThisDrawing.Application.Update
End Sub
发表于 2004-8-6 23:24:00 | 显示全部楼层
www.ikozmos.com for vlxls
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-18 21:33 , Processed in 0.148781 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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