473,324 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Writing and Parsing Excel Files

I'm using perl in windows 2000 OS.i'm using perl,v5.6.0 built for MSWin32-x86-multi-thread
i have two questions....
1) In an old thread I've read that to do this we need parseexcel and writeexcel modules which can be downloaded from cpan.
I've downloaded the two modules which are in zip format and unzipped them.When i tried to run the makefile, some warnings are coming that
->io:scalar.pm is a prerequisite it's not available
->storage_lite is a prerequisite it's not available
and so on...
what are these prerequisites?where can i get them and how to install them?

2) Is there any other method to parse and write to excel file without using the writeexcel and parseexcel?
Apr 2 '07 #1
4 3968
miller
1,089 Expert 1GB
Hi,

For installing cpan modules read the following documentation.

cpanfaq How to install Perl Modules

It is possible to install then manually like you're trying to do. But as you discovered, a lot of modules have prerequisites that you'll also need to download and install. Most of the automated install methods can take care of this for you.

As for if there are other modules that might do this functionality. Yes, there are, but those are the best that I know of. Just search cpan if you're curious. But either way you'll need to learn the more efficient methods for installing modules, so read the above documentation.

- Miller
Apr 2 '07 #2
Thank u Miller for ur reply...
Actually I've tried to install the parseexcel and write excel modules using ppm also, But I'm getting some errors there also.
Anyway I'll read the CPAN documentation and will try it out again.
Apr 2 '07 #3
miller
1,089 Expert 1GB
If you're using ActiveState, I would advise that the PPM is probably the way to go. Unfortunately for y'all, I'm not really in a position to suggest how one might fix installation problems as the documentation has always worked perfectly for me on all of my systems (*knocks on wood*).

Anyway, read on and good luck,

- Miller
Apr 2 '07 #4
dim05
1
Hello,

for 2) try code below:

Expand|Select|Wrap|Line Numbers
  1. #Open file and excel application
  2.  
  3. use Win32::OLE;
  4. $excel = Win32::OLE->GetActiveObject('Excel.Application')
  5.     || Win32::OLE->new('Excel.Application', 'Quit');
  6. $first_xls_file = $excel->Workbooks->Open("C:/anydirectory/anyexistingexcel.xls");
  7. $yourfirstworksheet= $first_xls_file ->Worksheets(1);
  8. $anyotheralsousefulworksheet= $first_xls_file ->Worksheets(2);
  9.  
  10. #Now write to any cell by ...
  11. $text = "hello";
  12. $yourfirstworksheetreport->Cells(1,1)->{Value} = $text;
  13. $yourfirstworksheetreport->Cells(2,1)->{Value} = "DOG";
  14.  
  15. #Now save the xls
  16. $first_xls_file->SaveAs("C:/anydirectory/anyexistingexcel.xls");
  17.  
##################
Of course you can create a new xls or do more things like playing with cell properties. Try searching for OLE and perl.
Of course with the code above you don't need to install anything additional
to the original Perl distribution-installation.
Unfortunately these interactions between Desk OLE and Perl are not documented (or don't know) but exist.
Apr 3 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Phil Powell | last post by:
What would one best recommend to parse an existing Excel spreadsheet (was done in Excel 97 or 2000 not sure to be honest)? I am looking for the most practical way of parsing an existing...
2
by: Nevo | last post by:
Can I write to files, say for example, to an excel spreadsheet and have it written in a certain order or in certain cells? Thanks, VAL
2
by: GIMME | last post by:
I can't figure an expression needed to parse a string. This problem arrises from parsing Excel csv files ... The expression must parse a string based upon comma delimiters, but if a comma...
1
by: Andre Ranieri | last post by:
I'm having trouble programatically inserting an Excel file into an Image column in our CRM package's SQL 2000 database. The function appears to work ok, but when I attempt to access the file through...
0
by: ed | last post by:
Hello All. I have seen many posts slightly similar to this question with no answer. Maybe you have some FAQs or something, sorry if I looks repetitive. Here is my Problem: In my...
22
by: JJ | last post by:
Whats the best way for me to pull out records from a tab delimited text file? Or rather HOW do I parse the text, knowing that the tabs are field delimiters and a return (I image) signifies a new...
1
by: =?Utf-8?B?ZmhpbGxpcG8=?= | last post by:
We have a code snippet that downloads data to Excel. it is writing row by row. This causes a performance issue. Any ideas on how to speed this up will be appreciated. Please find below an...
20
by: Marin Brkic | last post by:
Hello all, please, let me apologize in advance. English is not my first language (not even my second one), so excuse any errors with which I'm about to embarass myself in front of the general...
12
by: vijayarl | last post by:
Hi All, To Moderator : Sorry i have posted this querry to member rather putting in the forum. To All: Problem stmt: I am reading the data from the excel files & writing its content to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.