f



Reading an Excel .xls File without using Excel.Application?

Hi all,

My VB6 app needs to be able to read from an Excel .xls file.  However, the 
target computer won't have Excel installed.  All the online examples I've 
found for reading Excel files assume you're doing this...

Dim xl As Excel.Application
Dim xlsheet As Excel.Worksheet
Dim xlwbook As Excel.Workbook

...which obviously won't work.  How else can I go about it?  Or, what's the 
bare minimum I could install to get this functionality?

Thanks,
Leif

-- 
Leif Bloomquist
leif(at)schemafactor(dot)com
http://home.ica.net/~leifb/

"Once secure, saturate the area with plasma mortars and spicy barbecue
sauce." 


0
Leif
1/18/2007 8:25:03 PM
comp.lang.basic.visual.misc 10153 articles. 0 followers. Post Follow

3 Replies
792 Views

Similar Articles

[PageSpeed] 38

On Thu, 18 Jan 2007 15:25:03 -0500, "Leif Bloomquist" <spam@127.0.0.600>
wrote:

>
>Hi all,
>
>My VB6 app needs to be able to read from an Excel .xls file.  However, the 
>target computer won't have Excel installed.  All the online examples I've 
>found for reading Excel files assume you're doing this...
>
>Dim xl As Excel.Application
>Dim xlsheet As Excel.Worksheet
>Dim xlwbook As Excel.Workbook
>
>..which obviously won't work.  How else can I go about it?  Or, what's the 
Leif

Apply to Microsoft and get a licence to see the internal format of .xl?
files. 

They will want to know why you need it, but it is available (or was).

Richard
Web pages: http://www.caravanningnow.co.uk/ for caravanning,
http://www.rcole.org/ for my personal web site and
http://www.homeindorset.co.uk because I love the email address.
-- 
Top 20 Replies by Programmers When Their Programs Don't Work: 4. "You can't
use that version on your system."
0
ispcrco1 (162)
1/19/2007 6:26:33 PM
On Fri, 19 Jan 2007 18:26:33 +0000, Richard Cole
<ispcrco@hotmail.com.invalid> wrote something that piqued my interest
enough to reply with:

>Apply to Microsoft and get a licence to see the internal format of .xl?
>files. 
>
>They will want to know why you need it, but it is available (or was).
>
Both the older formats such as BIFF and newer XML formats are actually
publically available (otherwise Open Office would be in breach for
publishing almost all MS Office file formats), although most code you'll
find on the 'net that doesn't require Excel installed deals with writing
them not reading them (as writing a BIFF2.1 spreadsheet is trivial and
readable by almost all Excel versions).

Reading them without Excel being installed on the 'server' machine,
particularly when you may have to deal with multiple possible versions
(BIFF, binary, XML, etc) is not as trivial, which is why most controls
available to do that will cost you upwards of $150...I haven't seen a
free control or code to do it.

It is supposedly possible to use JET/ADO to access an XLS as if it where
a DB (similarly to the way you can access an Access MDB without Access
installed), but I've not got it to work consistently across different
versions of MS Office, or even know if it works without Excel installed
as all my  dev machines have MS Office installed; 

http://www.vbforums.com/showthread.php?t=382404

http://support.microsoft.com/kb/257819

You could try to write your own method by decompiling the file format
(which I presume is what Richard's comment refers to);

http://www.wotsit.org/search.asp?page=1&s=xls

http://sc.openoffice.org/excelfileformat.pdf

....but I don't recommend it, it's not a trivial task. If your business
is not willing to pay for a pre-built control to do it using VB6 then
you're better off looking at getting whoever generates the XLS to export
to CSV or similar so that it's more easily readable (it would be simpler
to write an export macro and build it into the user workbooks).

As to bare minimum install to make OLE work, you're going to have to
install the bulk of Excel anyway, which I guess you were trying to
avoid.
-- 
Alfie [UK]
<http://www.delphia.co.uk/>
Can fat people go skinny-dipping ?

0
alfie1 (174)
1/19/2007 10:20:48 PM
"Alfie [UK]" <alfie@mail.invalid> wrote in message 
news:4ff2r2134n31768r6ha2s1ldop54litc80@4ax.com...

> you're better off looking at getting whoever generates the XLS to export
> to CSV or similar so that it's more easily readable (it would be simpler
> to write an export macro and build it into the user workbooks).
>
> As to bare minimum install to make OLE work, you're going to have to
> install the bulk of Excel anyway, which I guess you were trying to
> avoid.

Yeah, we'd pretty much decided to go the CSV route, I just wanted to check 
out other options before making the switch.  Thanks for the info! 


0
Leif
1/26/2007 2:23:42 PM
Reply:

Similar Artilces:

How to Read data from excel file without converting a excel file into .csv or any other format
Hello, Can somebody suggest me how to read from an excel file (consisting of 10 work sheets) to an array? Thanks, She Hello, it's right that you can use activeX. (For example&nbsp;with rhe report generation toolbox from&nbsp;ni) But there are some problems: &nbsp; 1. You have to have&nbsp;excel installed on the targed PC. (to get the ActiveX interface) 2. There exists different "Microsoft Excel x.x Object Library Version x.x" which have different methods and&nbsp;properties.&nbsp;If a costumer has an other version, it could be that it doesn't work. 3....

How to read in all excel files from a excel file folder
Hello! I#ve one question. I want to read in all excel files from a file folder into matlab. How can i create a m.file witch reads in all my excel files????? thx i first get all files into a variable: FileNames=dir('*.xls'); then crate a loop to open each excelfile: for i=1:size(FileNames,1) A=xlsread(Filenames(i,1).name; end good luck Iris E.. wrote: > > > Hello! > > I#ve one question. I want to read in all excel files from a file > folder into matlab. > How can i create a m.file witch reads in all my excel files????? > > thx > i ...

ANN: LibXL
Hi All, We are happy to announce our new product: LibXL - Direct reading and writing of the Excel files LibXL from www.libxl.com is a high performance, royalty free library that c= an read and write Excel files. It doesn't require Microsoft Excel and .NET = framework, combines an easy to use and powerful features. Library can be us= ed to Generate a new spreadsheet from scratch Extract data from an existing spreadsheet Edit an existing spreadsheet Supports Excel 97-2003 binary formats (xls) and Excel 2007/2010 xml formats= (xlsx) Images, multiple sheets and much more is ...

vb/Excel: How to read an excel file in a column WITHOUT specifying the range ??
Hello, all. I found a bit of code that lets me read an Excel file from and to a specifi range. See the code below. But what if I only want to specify the STARTING position and simply want it to continue reading down the column until it hits an empty cell? Does anyone know how to do this? Thanks! Here is the range-only code: ' ** turn screen updating off, prevent the user from seeing the source workbook ' ** then find the file and identify both the worksheet and range Application.ScreenUpdating = False Set sourcewb = Workbooks.Open(file, False, True) listitems...

Want to generate Excel charts inside Excel files by Perl CGI generating Excel files using WriteExcel.pm
Hi all, My web-based application requires me to generate an Excel file with the results of an analysis in the server--something I can now do using the WriteExcel.pm module, but I'd like to do more in my Perl CGI. Specifically, I'd like to generate a graph/chart plotting values in column C in a worksheet with values in column A, and also values in column B against values in column A, both in the same graph/chart. Please note that I know how to plot a graph/chart once I open a file in Excel--my question is what I can do in the Perl CGI using WriteExcel (or associated or other Perl modul...

Can not save excel file when dispose excel because the file is read-only. How can I do it?
I can not save an excel file generated by report generation toolkit in LV becaues it is a read-only file. How can I generate a un-read-only file? Thanks. Is my question clear enough? What I want to do are: 1. create or open a file in LV (use Open/create/replace File.vi), generate a new report, write data to the report, save report to file before dispose it. 2. use subvi to enter file's path and name, don't use labview's file dialog box or Excel's menu because we are using touch screen and they are not big enough for fingers. What I encountered are: got error message after ...

[xlsread()] is there a diff between (french) excel 2010 and (french) excel 2003 when using xlsread() to read ".csv" files
Hi, I am successfully reading decimal numbers (french format with ",") from ".csv" files (french .csv format with ";" as delimiter) using xlsread() on a PC with Windows 7 and (french) Excel 2010. Then i am using the MATLAB compiler (R2013a) to generate a standalone Windows executable MainApp.exe but when i execute my MainApp.exe (together with MCR v81) on another PC with Windows 7 and (french) Excel 2003 it looks that xlsread() does not recognize decimal numbers using ",". Both Microsoft Excels are French versions! Did anyone face a similar issue? Re...

write excel files without excel on the pc
Is it possible to write excel files from Matlab without Excel software installed on the PC? I tried xlswrite but it failed because it tried to open excel. Is there an other way? Thanks for your help. bruno: <SNIP wants to create an excel ss without calling the app look at what <hans-peter suter> has to offer <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=8323&objectType=FILE> us ...

Reading the excel file from simulink block and giving as output the modified excel file to another simulink block
Hi everyone, I have created one simulink block. In the simulink block i created one embedded matlab function and trying to read an excel file and extract some particular values and give it as input to another simulink block. Could somebody tell me how to do this. The size of the excel file keeps varying. I hope iam clear else please let me know. It is very important for me to solve this problem to proceed further. Please help. Thanks Desireddy. ...

Using Excel in Visual Basic
I have a VB6 application running on NT. All the app does is open a ..csv file and then save it as .xls with a password as below. It's been working fine for several weeks, but failed today. It finishes without any errors, it just doesn't do convert to xls part. It prints the message to the log okay. I rebooted the server it is on, and it still didn't work. At this point this and MS Outlook were the only applications running on the server. Memory looked fine (20% usage) and CPU was fairly flat. I then started excel manually and closed it and then it started working again! Would any...

Create Excel File without Ms. Excel inside
Hi to all, Does anybody here know an easy way to create an excel file (.XLS) without Ms. Excel install inside? Regards, Darmadi Darmadi > Does anybody here know an easy way to create an excel file (.XLS) > without Ms. Excel install inside? Yes, but not with VO, someone else may know though<bg> CYA Steve You can do this only with the XML version: 2003 Pro or Office 2007. And then it is quite easy. (But use google) "steve_dar@yahoo.com" <steve_dar@yahoo.com> wrote in message news:dbe314f1-2664-48e1-9993-6816bc625681@q14g2000vbn...

Writing in Excel format without opening excel file again and again
I have to write huge data into excel file from MATLAB. xlswrite opens ad closes the excel file many times. So, taking long time to write. To write into 240 cells only it took 109 sec. But I may write thousands of cells. Is there any faster way to do that? Thanks. "Rinachi Garg" wrote in message <jrr8eb$3im$1@newscl01ah.mathworks.com>... > I have to write huge data into excel file from MATLAB. xlswrite opens ad closes the excel file many times. So, taking long time to write. To write into 240 cells only it took 109 sec. But I may write thousands of cells. Is there any f...

change file without excel extension to excel extension
I have files without excel extension and I want to change them to files with excel extension "Benjamin Anderson" <benkandah@hotmail.com> wrote in message news:iic8pb$j6u$1@fred.mathworks.com... > I have files without excel extension and I want to change them to files > with excel extension The answer to the question as you asked it is simple -- use MOVEFILE to add the appropriate extension. The answer to the question I assume you wanted to ask -- how do I take a data file in $SOME_FORMAT and convert it into a Microsoft Excel workbook -- is much mor...

using excel cells to call another excel file
Hi all I am loading the data in excel using xlsload in matlab however i would like to know is there a way to call another excel file by clicking one excel cell in a special way , rather editting or deleting the content in the cell? Something similar to hyperlink Thanking you A ...

Web resources about - Reading an Excel .xls File without using Excel.Application? - comp.lang.basic.visual.misc

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Apple Stores planned for India as application is filed with regulators
... India Times , the company has recently taken a major step in accomplishing that goal. According to the report, Apple has just filed an application ...

Tech City UK received just 37 applications for a visa scheme that could allow 200 tech immigrants to ...
Tech City UK, a taxpayer-funded government organisation, has received just 37 applications since April 2015 for a dedicated technology visa that ...

Tech City UK received just 37 applications for a visa route that allows 200
Tech City UK, a taxpayer-funded government organisation, has received just 37 applications since April 2015 for a dedicated technology visa that ...

Toshiba Launches 40V N-ch Low ON-resistance Power MOSFET for Automotive Applications
Toshiba launched a 40V N-ch power MOSFET, &quot;TKR74F04PB,&quot; for automobile applications, including DC-DC converters, high capacity motor ...

MBA: Mortgage Applications Increased in Latest Weekly Survey, Purchase Applications up 22% YoY
From the MBA: Mortgage Applications Increase as Rates Continue to Drop in Latest MBA Weekly Survey Mortgage applications increased 8.8 percent ...

Mortgage applications up 8.8%
Defying expectations for the start of 2016, mortgage rates spiraled down further last week, spurring more applications.

The USPTO updates their refusal of Sony's 'Let's Play' trademark application
... and Trademarks Office shot them down. What was interesting was the USPTO’s justification for doing so. They didn’t originally deny the application ...

Digitimes Research: Vendors showcase more applications to promote personal security at CES 2016
Smart home device and service vendors were showcasing more devices and service applications dedicated to the promotion of personal security at ...

Application Containers Gain Traction Among IT Pros
The Robin Systems survey indicated 81 percent of respondents expect their companies to increase the investment in container-based technology. ...

Resources last updated: 2/3/2016 12:15:30 PM