Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: Copy text strings from AutoCAD into Excel

  1. #1
    Member
    Join Date
    2006-02
    Posts
    2
    Login to Give a bone
    0

    Default Copy text strings from AutoCAD into Excel

    I would like to be able to copy text strings from Autocad into Excel.
    i.e. my drawing have several text strings in it "test1", "test2", "test3", and so on, I would like to be able at the click of a button for Excel to open and copy each of the text strings in to a spreadsheet. I'm able to get excel to open and see the text entities, I have tested this by using a bog standard change text height macro. The problem I'm having is that Im unable to get vba to recognise the text strings. Can anyone help.


    Rgards

    Steve

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

    Default Re: Copy text strings from AutoCAD into Excel

    Steve, I wrote this some time ago
    This is not you exactly need but
    may lead you in the right way

    Tested A2005, Excel2003

    ~'J'~
    Attached Files Attached Files

  3. #3
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,409
    Login to Give a bone
    0

    Default Re: Copy text strings from AutoCAD into Excel

    Quote Originally Posted by sscott5
    The problem I'm having is that Im unable to get vba to recognise the text strings.
    Can you be more specific?
    C:> ED WORKING....


    LinkedIn

  4. #4
    Woo! Hoo! my 1st post
    Join Date
    2011-04
    Posts
    1
    Login to Give a bone
    0

    Default Re: Copy text strings from AutoCAD into Excel

    Thank you , this is a nice idea !

  5. #5
    Member
    Join Date
    2008-02
    Posts
    49
    Login to Give a bone
    0

    Default Re: Copy text strings from AutoCAD into Excel

    Quote Originally Posted by fixo View Post
    Steve, I wrote this some time ago
    This is not you exactly need but
    may lead you in the right way

    Tested A2005, Excel2003

    ~'J'~
    HI I had a look to your file and realted macro. But I have a question IS THERE A REASON to create the macro inside excel instead strarting from AUTOCAD.
    I'm asking you this question because I have a lot of difficulty to transfer data from Autocad 2005 to excel 2007.
    My Issue concern an already open an excel file, no problems if I create the Excel object as new.
    If you want I'll post the code.

    So your option could be a good idea starting from excel and getting data from Autocad.

    I'll try.
    Thank you.

    Thank you

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

    Default Re: Copy text strings from AutoCAD into Excel

    Hi grobnik,
    I have some experience with Excel/Acad interaction
    using early and late binding, so I need to see your code
    for the better understanding your task
    Guess, you need it on VB.Net or C#, let me know

    Thank you

  7. #7
    Member
    Join Date
    2008-02
    Posts
    49
    Login to Give a bone
    0

    Default Re: Copy text strings from AutoCAD into Excel

    Hi Fixo,
    thank you very much for your support.
    Here is a part of the code concerning the excel & Autocad integration. (Autocad 2005 & Excel 2007)
    I got the code from the web site and also from several support forum (included AUGI).
    The macro has been crated with Autocad 2005.

    Dim MyExcel As Object
    Dim MyExcelSheet As Object

    On Error Resume Next
    Set MyExcel = GetObject(, "Excel.Application")' <---- The MyEcel Objec is not retrived even if excel has been open. No msg box will be displayed. No new excel object will be created, if Excel is not running.

    If Err.Number <> 0 Then ExcelWasNotRunning = True
    Err.Clear ' Clear Err object in case error occurred.
    ' Check for Microsoft Excel. If Microsoft Excel is running,
    ' enter it into the Running Object table.

    If Err <> 0 Then
    Err.Clear
    Set MyExcel_F1 = CreateObject("Excel.Application")

    If Err <> 0 Then
    MsgBox "Could Not Load Excel!", vbExclamation
    End
    End If
    End If
    On Error GoTo 0
    MyExcel.Visible = True
    'Excel.Workbooks.Add
    MyExcel.Sheets("Foglio1").Select

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

    Default Re: Copy text strings from AutoCAD into Excel

    Ok, that's pretty easy what you doing with this code
    Please, explain me what is you goal,
    better yet step-by-step
    As I see this part is just get or create Excel object
    and what you want after?, sorry not clearly enough
    And also you didn't answer me what is the language you'll be
    prefer, this one is pure VBA, but in another thread
    you've asked about VB.NET as I remember it.
    Perhaps,I'm wrong though

  9. #9
    Member
    Join Date
    2008-02
    Posts
    49
    Login to Give a bone
    0

    Default Re: Copy text strings from AutoCAD into Excel

    Quote Originally Posted by fixo View Post
    Ok, that's pretty easy what you doing with this code
    Please, explain me what is you goal,
    better yet step-by-step
    As I see this part is just get or create Excel object
    and what you want after?, sorry not clearly enough
    And also you didn't answer me what is the language you'll be
    prefer, this one is pure VBA, but in another thread
    you've asked about VB.NET as I remember it.
    Perhaps,I'm wrong though
    My MAIN problem concern the creation of an excel object, which should be represented by an existing opened excel file.
    The code that I posted doesn't work with AUTOCAD 2005 and EXECEL 2007, the code is pure VBA, I never ask for VB.NET.
    The routine hangs Set MyExcel_F1 = CreateObject("Excel.Application") the object will be not created.
    The code provide for an error message but it doesn't appear, ExcelWasNotRunning variable it's always true.

    Probably some part is missing (both MSOffice, or Autocad) I don't know.

    When I have available the Excel Object I'll transfer some data from it to a Autocad Table.
    The Autocad Table in 2005 version is not so easy to manage, linking to an excel worksheet.

    I hope this helps you understanding more my ISSUE !.
    Thank you.

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

    Default Re: Copy text strings from AutoCAD into Excel

    Ok it's clearly enough,
    I will be free just tomorrow only
    Can you wait for?
    on the quick glance I see just that these
    two objects are different:

    MyExcel_F1 and MyExcel

    Thank you,
    See later
    Cheers

Page 1 of 3 123 LastLast

Similar Threads

  1. Macro to copy data from Autocad to Excel
    By jayabalan1003695339 in forum VBA/COM Interop
    Replies: 1
    Last Post: 2015-05-29, 10:33 PM
  2. Entering text from excel into autocad
    By mbrandt5 in forum VBA/COM Interop
    Replies: 0
    Last Post: 2015-03-27, 12:51 PM
  3. 2015: IS IT POSSIBLE TO COPY TEXT FROM AUTOCAD INTO AN EXCEL SHEET ???
    By doyle.84974 in forum AutoCAD General
    Replies: 3
    Last Post: 2015-02-05, 12:50 PM
  4. text strings on schedules?
    By timsea81 in forum Revit MEP - General
    Replies: 1
    Last Post: 2009-05-08, 04:30 PM
  5. Replies: 1
    Last Post: 2006-10-29, 07:09 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
  •