ASE, SQL, OLE, ADE

ASE, SQL, OLE, ADE

Reply

Excel question

84 Views, 4 Replies
12-05-2002 11:19 PM
I am looking for a good location of information regarding inserting
information from excel into autocad.
any info is appreciated


Phil
*Dotson, Terry W.
Post 2 of 5

Re: Excel question

12-06-2002 02:52 AM in reply to: *JIC
JIC wrote:

> I am looking for a good location of information regarding inserting
> information from excel into autocad.

What exactly are you looking to do?

Terry

Re:

12-06-2002 03:32 AM in reply to: *JIC
use it for my plumbing/mechanical calcs that i have set up in excel.

Terry W. Dotson wrote:
> JIC wrote:
>
>
>>I am looking for a good location of information regarding inserting
>>information from excel into autocad.
>
>
> What exactly are you looking to do?
>
> Terry
*Goodfellow, John
Post 4 of 5

Re: Excel question

12-06-2002 04:24 AM in reply to: *JIC
Take a look at the ACAD help file "ActiveX and VBA Developers Guide", Ch.
12. Here's a code sample. Include a ref. to the Excel 8.0 object library
in your ACAD VBA project.

Private Sub UseExcel(strFSpecXLS As String)
' strFSpecXLS is the full path + filename + ext of the Excel file
Dim oExcel As Excel.Application, oWrkBk As Excel.Workbook, oWrkSh As
Excel.Worksheet

If Dir(strFSpecXLS) <> "" Then
Set oExcel = New Excel.Application
Set oWrkBk = oExcel.Workbooks.Open(strFSpecXLS)
Set oWrkSh = oWrkBk.Worksheets("WorksheetName")

' Assign input values to cells
' oSensor is a class object
' oRecSet is an ADO recordset contained in oSensor
oWrkSh.[C8] = oSensor.oRecSet!GlaWid
oWrkSh.[C9] = oSensor.oRecSet!GlaHgt
oWrkSh.[C10] = oSensor.oRecSet!ActWid
oWrkSh.[C11] = oSensor.oRecSet!ActHgt

' Run calculations
oWrkSh.Calculate

' Return output values to recordset
oSensor.oRecSet!TGRTopMax = oWrkSh.[D24]
oSensor.oRecSet!TGRTopMin = oWrkSh.[C24]
oSensor.oRecSet!TGRGlaMax = oWrkSh.[H24]
oSensor.oRecSet!TGRGlaMin = oWrkSh.[G24]
Else
Err.Raise vbObjectError + 9998, strThisProc, "File not found: " &
strFSpecXLS
End If

oWrkBk.Close True ' True means "save the workbook changes"
oExcel.Quit
End Sub
--
John Goodfellow
irtfnm
use john at goodfellowassoc dot com


"JIC" wrote in message
news:3DF0C00E.5000508@netscape.net...
> I am looking for a good location of information regarding inserting
> information from excel into autocad.
> any info is appreciated
>
>
> Phil
>
*Dotson, Terry W.
Post 5 of 5

Re:

12-08-2002 10:21 PM in reply to: *JIC
JIC wrote:

> use it for my plumbing/mechanical calcs that i have set up in excel.

And then produce a table in the drawing, or draw those as objects?

Terry
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post