Jump to content

Auto cad --> excel


jackseel
 Share

Recommended Posts

  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

  • SEANT

    13

  • jackseel

    8

  • xxfaxx

    6

  • rkmcswain

    1

Top Posters In This Topic

Posted Images

sorry, my bad

i was using visual basic from excel, but now using it from autocad i can make the command work except with one little thingy. After i select an entity on a leyer with which to focus, i get a new error "run-time error 91, object variable or with block variable not set", and when i click the "debug" option this part "Set objRange = objExcel.ActiveWorkbook.ActiveSheet.Range("A1")" gets highlighted in yellow...

 

I suspect i am still doing something wrong.

Link to comment
Share on other sites

I could make it work somehow but i cannot select the objects i want..

I mean, when i activate the command, the information goes right to excel just like that. no preselection..

well, im still learning. I changed your code a tiny bit to get the info in the cell i want.

thanks

Link to comment
Share on other sites

It sounds like you're making progress. Keep asking questions and, if necessary, post the modifications you've made. The forum will respond with the necessary corrections.

Link to comment
Share on other sites

Is there a book or something you recommend t see what every piece of code means?? Im using "afralisp" website and some other resources to learn autolisp and vba but i think im going to need more. I will post the code as soon as i get to the computer.

Link to comment
Share on other sites

the piece of code i edited was this one

Set objRange = objExcel.ActiveWorkbook.ActiveSheet.Range("A1")

 

I changed that to this

[code]Set objRange = objExcel.ActiveCell

[/code]

 

And that allowed me to get the information to a cell in excel that i had clicked previously, instead of getting the info on the first cell.. i know it is not much of a change. Trying to understand something from all that code (without knowing anything) is quite a challange.

 

thanks for the link. i will check it out

Link to comment
Share on other sites

+1 I'm trying to get started using VBA in Autocad and this is good stuff, though I must say having used Excel VBA for many years, this isn't as straightforward as I had thought it would be.

Link to comment
Share on other sites

I, too, learned and did much of my early programming with Excel VBA. As I recall, The transition to AutoCAD did seem to present a conceptual/philosophical variance between the two APIs. It didn't take long, fortunately, to become familiar with the AutoCAD way of doing things. I don't perceive the discontinuity anymore, at least.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...