See the top rated post in this thread. Click here

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 40

Thread: excel data to draw line in autocad.

  1. #21
    Member
    Join Date
    2013-02
    Location
    Kolkata, India
    Posts
    7
    Login to Give a bone
    0

    Post Re: excel data to draw line in autocad.

    hi fixo ,i have attached the required autocad file here.

  2. #22
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: excel data to draw line in autocad.

    Hi,
    I see in your drawing there are two embedded OLE objects with
    "Embedded" status, I don't know entirely how to work
    with this object types. Just a guess: maybe you need to create data link
    with Excel file instead and work further from this point
    But I have not have an experience with this deal as well,
    search for VBA datalink on Google or on this forum

  3. #23
    I could stop if I wanted to
    Join Date
    2006-03
    Location
    San Cristobal, Guatemal
    Posts
    439
    Login to Give a bone
    0

    Default Re: excel data to draw line in autocad.

    Quote Originally Posted by fixo View Post
    Hi Darren, I just tested this one on my AutoCAD 2010,
    try to change references on your A2012 Relesase,
    then let me know about
    Sorry, it took so long to reply. How do I change the references?

  4. #24
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: excel data to draw line in autocad.

    Hi Allen, See PM
    Open project in VBAIDE then go to Tools->References
    ans see References wich was marked with yellow ticks,
    then change them all relative to your current version
    Last edited by fixo; 2013-02-15 at 05:14 PM.

  5. #25
    Member
    Join Date
    2013-02
    Location
    Kolkata, India
    Posts
    7
    Login to Give a bone
    0

    Post Re: excel data to draw line in autocad.

    Thanx u fixo sir for your quick response .....actually i need to say ..i want instant drawing in autocad form canal data put excel. actually there is no need of OLE object in autocad at my end . i added it my sample drawing for ready reference of canal area calculation...thank you once again...

  6. #26
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: excel data to draw line in autocad.

    Then upload a sample Excel sheet with same data,
    because I have not have so much time to recreate one from your drawing

  7. #27
    Member
    Join Date
    2013-02
    Location
    Kolkata, India
    Posts
    7
    Login to Give a bone
    0

    Post Re: excel data to draw line in autocad.

    hi fixo sir,thanx again for response from you end,yes i understand your time.i enclosed the excel data file here.........for you.

  8. #28
    Member
    Join Date
    2013-02
    Location
    Kolkata, India
    Posts
    7
    Login to Give a bone
    0

    Post Re: excel data to draw line in autocad.

    i also required to annonate the points in autocad drawing ...

  9. #29
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: excel data to draw line in autocad.

    For the first test you do next
    Copy and add this code in AutoCAD VBAIDE (Alt+F11)
    in the module
    then execute it, but change before all settings and file name
    within the code block
    See if this code will return all values in AutoCAD command line after

    Code:
    Option Explicit
    ' Notes:
    ' 1. requires settings: Tools -> Options -> General tab -> Error trapping field -> check "Break on Unhandled errors"
    ' 2. requires reference to Microsoft Excel XX.0 Object Library
    Function IsExcelRunning() As Boolean
    Dim xlApp As Excel.Application
    On Error Resume Next
    Set xlApp = GetObject(, "Excel.Application")
    IsExcelRunning = (Err.Number = 0)
    Set xlApp = Nothing
    Err.Clear
    End Function
    
    Sub ReadExcelRange()
    ' To read data from specific Excel range
    Dim xlApp As Excel.Application
    Dim blnIsOK As Boolean
    Dim xlBook As Excel.Workbook
    Dim xlSheet As Excel.Worksheet
    blnIsOK = IsExcelRunning()
    If blnIsOK Then
    Set xlApp = GetObject(, "Excel.Application")
    Else
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = True
    xlApp.UserControl = True
    End If
    Dim xlFileName As String
    ' set full path of your Excel file here:
    xlFileName = "C:\MyFolder\MyFile.xlsx"
    xlApp.Application.ScreenUpdating = False
    ' open file for read
    Set xlBook = xlApp.Workbooks.Open(xlFileName)
    Set xlSheet = xlBook.Worksheets("Sheet1") ' desired sheet name , same if use xlBook.Worksheets(1)
    xlSheet.Activate
    Dim xlrange As Excel.Range
    Set xlrange = xlSheet.Range("A1:F25")
    xlrange.Select
        Dim cols As Long
        Dim rows As Long
        cols = xlrange.Columns.Count
        rows = xlrange.rows.Count
    Dim rangeValue As Variant
    rangeValue = xlrange.Value2
    
    ' clean up memory
        xlBook.Close False
      Set xlBook = Nothing
        xlApp.Quit
      Set xlApp = Nothing
      DoEvents
    ' go to Autocad then
       Dim i, j
        For i = 1 To rows
        For j = 1 To cols
    ' read cell data separatelly just for test
    ThisDrawing.Utility.Prompt vbLf & CStr(rangeValue(i, j))
        Next
        Next
    End Sub

  10. #30
    Member
    Join Date
    2013-02
    Location
    Kolkata, India
    Posts
    7
    Login to Give a bone
    0

    Smile Re: excel data to draw line in autocad.

    Very very Good morning & thank u fixo sir, i am trying this........i will be back later

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. use excel data to draw
    By santhoshi.civil114776650 in forum AutoCAD General
    Replies: 13
    Last Post: 2017-05-15, 02:36 AM
  2. Replies: 13
    Last Post: 2014-07-01, 02:23 PM
  3. Bring data to Excel from AutoCAD
    By cparvez in forum Dot Net API
    Replies: 1
    Last Post: 2014-05-27, 08:46 PM
  4. Replies: 4
    Last Post: 2014-01-01, 07:58 PM
  5. import text and data from excel into autocad
    By elipman in forum AutoCAD General
    Replies: 4
    Last Post: 2008-12-22, 08:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •