TheSwamp
Code Red => VB(A) => Topic started by: MSTG007 on October 13, 2015, 09:32:31 AM
-
I was wondering if there is a certain VBA Script that I can select a Cell and have the Cell Value you transferred to the Active AutoCAD Command line.
-
i would think that it could be done fairly easily, let me see if I have some code that will do it easily
-
That would be sweet!
-
this post http://www.theswamp.org/index.php?topic=21962.msg265072#msg265072 (http://www.theswamp.org/index.php?topic=21962.msg265072#msg265072) should get you all the code you need to connect, open a spreadsheet, and search for a row/column. from there you should be able to read the cell and send it back to autocad, probably using the dreaded send command.
-
an alternative approach could be using Excel as the server applicaton controlling Autocad
in that case the following could be of any help
1) insert an event handler for selection changes in your sheet module
2) have it send the selected cell value to Autocad command line via the "prompt" method of the "Utility" object
something like this
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Rows.Count = 1 And Target.Columns.Count = 1 Then ThisDrawing.Utility.prompt Target.value
End Sub