Is there a better option than Getobject to access a .xls?

D

Dave F

Hi

Excel '98 & 2002. AutoCAD 2002

I'm running a vba routine within AutoCAD to access the info within a .xls
file.
I'm using Getobject, but have just been told that even though it doesn't
display the spreadsheet, it still loads it into an instance of Excel.

Is this correct?

In AutoCAD VBA there's a command (ObjectDBX) to access other AutoCAD files
databases without loading in an instance.

Is there an equivalent in Excel?

Thanks in advance

Dave F.
 
J

Jon Peltier

Dave -

In Excel, you could use Application.Workbooks("Name.xls").Open, but from
AutoCAD you'd have to use GetObject anyway to open a new instance or
access a running instance of Excel.

- Jon
 
T

Tom Ogilvy

If you want to work with the file, unless you write your own file
interpreter, then you need to open excel. If your file is set up like a
database and you just want to retrieve the data, you can treat an excel file
as a database file and use ADO or DAO.
 
D

Dave F

Tell me more...
If your file is set up like a database

Do I have to do anything special to do this?
My workbook has a few worksheets with standard columns of numeric numbers.
and you just want to retrieve the data, you can treat an excel file
as a database file and use ADO or DAO.

I have vague memories that ADO is newer than DAO. Correct?
Which is better/faster of the two?

Are they faster than using GetObject, which definately slows my routine
down?

Thanks in advance

Dave F.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top