.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Exporting Table To Excel Using VB in VB.Net

4 REPLIES 4
Reply
Message 1 of 5
cncah
2246 Views, 4 Replies

Exporting Table To Excel Using VB in VB.Net

Hello, I'm writing a stand-alone program that will access an AutoCAD drawing and extract the text data from a table and export it to Excel. I know I can use the TABLEEXPORT command but that requires user input. I'm capable of getting the data out of an excel worksheet but don't know how to do it in AutoCAD. This will be my first program that I've tried to write for accessing AutoCAD. Would it be easier to get the data from the table in an array or list, then open a blank worksheet in excel and manually create the excel BOM? I'm needing this info for creating multiple Bill Of Materials for 4 different softwares. Hence my need for a stand-alone program in VB.Net. I'm just curious as to what is the easiest route to take, export the table, or grab the data and create my own BOM in excel with the list of part numbers. I'll include a picture of the table I'm accessing. I'm only needing the text in the title, and the values from C:4 down to the end of the table. Any help will be greatly appreciated. I'm also open to the idea of using an AutoLisp program to export the table data if that would be more convenient. And F.Y.I, I was just able to connect to AutoCAD and draw a simple polyline this afternoon so my AutoCAD VB command knowledge is pretty limited.

4 REPLIES 4
Message 2 of 5
AubelecBE
in reply to: cncah

HI. for information, i use a DLL (Free use) : ClosedXML.

it is very easy to create directly a file .xlsx.

 

go here for DL the file : https://closedxml.codeplex.com/documentation

Add this DLL in your projet and go..

no more need excel. only a viewer needed on my pc.

 

 

 

Message 3 of 5
cncah
in reply to: AubelecBE

I know how to create excel tables. What I'm wanting to do is take a table from AutoCAD and export that to excel.

Message 4 of 5
ryan.leeMZ4SX
in reply to: cncah

Hey, I'm also interested in this from C#.NET. Programmatically exporting a table.

 

Any normal human may expect an export method available to the Table class, but that's obviously too easy. I hope my sarcasm makes me look stupid and there is an easy way I have failed to see, so I can use it.

Message 5 of 5
Juergen_Becker
in reply to: cncah

Hi,

Kean Walmsley wrote a Posting on his blog that explain how to read and update a table in AutoCAD.

 

Here is the link:

http://through-the-interface.typepad.com/through_the_interface/2007/08/updating-an-exc.html

http://through-the-interface.typepad.com/through_the_interface/2014/02/exporting-an-autocad-table-to...

 

Reagrds Jürgen

I hope my tip helps. If so then give me kudos and mark the tip as a solution.
Thanks.

Jürgen A. Becker
Building Services

Development and Support
Autodesk Forge Spezialist


CAD-Becker.de
https://www.CAD-Becker.de

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost