Author Topic: Excel Cell Value to Command Line  (Read 4157 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Excel Cell Value to Command Line
« 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.
Civil3D 2020

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Excel Cell Value to Command Line
« Reply #1 on: October 14, 2015, 10:27:19 AM »
i would think that it could be done fairly easily, let me see if I have some code that will do it easily
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Excel Cell Value to Command Line
« Reply #2 on: October 14, 2015, 11:27:19 AM »
That would be sweet!
Civil3D 2020

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Excel Cell Value to Command Line
« Reply #3 on: October 15, 2015, 08:24:07 AM »
this post 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.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

RICVBA

  • Newt
  • Posts: 62
Re: Excel Cell Value to Command Line
« Reply #4 on: October 17, 2015, 01:26:01 AM »
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
Code: [Select]
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