AutoHotkey Community

It is currently May 26th, 2012, 5:40 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Read .XLS without Excel?
PostPosted: April 22nd, 2009, 10:32 pm 
Offline

Joined: September 8th, 2008, 8:38 pm
Posts: 33
Any way to read fields directly from an .XLS file without Excel?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 23rd, 2009, 2:36 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
Not using Autohotkey; .xls is a binary file.

However, if you tell Excel to export the file as .csv, AHK can read that.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 23rd, 2009, 5:11 am 
Offline

Joined: December 28th, 2005, 10:46 am
Posts: 99
truevis wrote:
Any way to read fields directly from an .XLS file without Excel?
Yes. If you haven't Excel, you can use the COM Standard Library and use ADO (ActiveX Data Objects), witch is part of the Microsoft Data Access Components (MDAC) by reading ADO COM - Database Query. You will need to know the connection string (someting like : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";") to connect to the database and at least a little of SQL command syntax (for example here) to achieve retrieving the data you want to. In this case, I think that you can't make calculations but only use Excel as a database. The use is in this case almost the same as reading an Access database without Access.

In the other hand, if you have excel and that you don't want it to be visible, but that it isn't a problem to use it, you can do the job with (again) the COM Standard Library and by looking at MS Office Automation Functions (via COM) [thanks Sean]. You connect to Excel (an existing instance or you launch it) and set it's "visible" property to false. You will need to know at least a little of VBA.

Si it's possible, but (very) hard if all that you red from me is an E.T language.

Good reading.
Hope it helps.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2009, 1:50 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
i could be wrong but i am relativly sure this still requires excell installed on the machine to work
:cry:

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2009, 5:20 am 
Offline

Joined: December 28th, 2005, 10:46 am
Posts: 99
tank wrote:
i could be wrong but i am relativly sure this still requires excell installed on the machine to work
:cry:

May be you're right. I must say I don't know. :oops: To try... But if Excel isn't installed, how to get a CSV file from an Excel one ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2009, 6:30 am 
Offline

Joined: April 23rd, 2009, 7:33 pm
Posts: 4
Perhaps you could use the Excel Viewer and automate it?
http://www.microsoft.com/downloads/deta ... laylang=EN

Also, check out ODBC, it allows you to read Excel files. Lots of links out there, but some of the better ones are for using JDBC (Java) to read the Excel files. That's what we use, though I honestly don't know if you need Excel - all of our machines have Excel installed.

Regards,
Eric


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2009, 2:50 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
as long as the data is all your after not the vba
you could use open office or excel viewer which are both free
odbc i believe relies on drivers that come with excel for excel files. Tho it may be posible to download those drivers for free.(never bothered looking)
I would just get excel viewer tho

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2009, 6:31 pm 
Offline

Joined: April 28th, 2007, 4:06 pm
Posts: 85
You could download OpenOffice at http://www.OpenOffice.org.
It will open and read .xls files, although you need to download something else that currently escapes me to open the openoffice files with excel. It is possible, however, I am misunderstanding the question :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: DLL to read XLS file
PostPosted: November 8th, 2010, 9:40 pm 
I am a scientific programmer and I had to process a lot of measurement data in XLS files.
Here you can find a free DLL and a sample program (C) :
http://perso.numericable.fr/hserindat/xlsread/
Good luck


Report this post
Top
  
Reply with quote  
 Post subject: Re: DLL to read XLS file
PostPosted: November 8th, 2010, 9:50 pm 
Offline

Joined: September 8th, 2008, 8:38 pm
Posts: 33
henrin wrote:
...Here you can find a free DLL and a sample program (C) :
http://perso.numericable.fr/hserindat/xlsread/
...
Great. Can anyone think of a way to use that DLL directly in AHK? Or would we have to modify and compile the sample C++ code to make it output text and then read-in that text?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2010, 7:01 pm 
Offline

Joined: September 15th, 2006, 10:25 am
Posts: 567
see this example of how it can be done -> http://www.autohotkey.com/forum/viewtopic.php?t=65941


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2010, 7:15 pm 
Quote:
Can anyone think of a way to use that DLL directly in AHK?

See: DllCall()


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, batto, Bing [Bot], BrandonHotkey, Miguel, mrhobbeys, notsoobvious, rbrtryn and 66 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group