473,698 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Not able to open excel sheet created by Spreadsheet::Wr iteExcel .

16 New Member
Hi,

When I tried to open excel sheet created by below code with MSexcel it showing "Unable to read file " error .

Expand|Select|Wrap|Line Numbers
  1. use Spreadsheet::WriteExcel;
  2. $workbook = Spreadsheet::WriteExcel->new("sm2.xls");
  3.  
I am using winxp OS and MS excel 2003 ....


Advance thanks fr any help on this ..... its urgnt fr me...!!
Oct 10 '09 #1
7 3773
numberwhun
3,509 Recognized Expert Moderator Specialist
@somsub
As shown in the modules cpan page, did you try single quotes instead of double quotes? Also, check the path to the file to ensure its in the same location as the script.

Also, please use code tags when putting code in the forums.

Regards,

Jeff
Oct 11 '09 #2
somsub
16 New Member
yaa... !! I tried with single quote in the place of double quote but got the same "Unable to read file " error .
Oct 11 '09 #3
numberwhun
3,509 Recognized Expert Moderator Specialist
@somsub
Ok, what about the other suggestion... the path to the file? Is it located where the script is? If not, then you will probably have to tell the script that.
Oct 11 '09 #4
somsub
16 New Member
yaa.... It is located in the same folder where the script is . But I tried with different path also but got the same error .
Oct 11 '09 #5
numberwhun
3,509 Recognized Expert Moderator Specialist
Ok, now that I have opened my eyes and reread your original question I can see you are trying to open the newly created file with Excel.

So, does the file that was created have a size other than zero? Also, the code you showed, is that all there is or did you create data and populate the workbook? If not, that may be the issue you are having.

Regards,

Jeff
Oct 12 '09 #6
RonB
589 Recognized Expert Moderator Contributor
You need to show us more of your code.

Do you have any error handling on the file creation?

Are you populating the file with any data?

Did you explicitly close the file before trying to open it with Excel?

Are you manually opening the file in Excel or are you doing it in your script via Win32::OLE?
Oct 13 '09 #7
somsub
16 New Member
Thanx guys fr ur interest and valuable inputs .....
As per your suggestion I added one more line that is "$workbook->close();"
to close it explicitly at the end of previously mentioned code . After the execution of this line i could able to open the excel sheet manually with MS excel with out any error.

Thanks a lot .
Oct 13 '09 #8

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

Similar topics

2
7374
by: Fabio | last post by:
Hello, there's a module called Spreadsheet::WriteExcel. It allows me to create a new worksheet and edit its cells: my $workbook = Spreadsheet::WriteExcel->new('my.xls'); my $worksheet = $workbook->addworksheet(); $worksheet -> write('A2', 222); But how can I put some values into the cells of an existing worksheet?
4
14692
by: tito | last post by:
I am using Active Perl for running perl programs.I am finding difficulty in installing Spreadsheet::WriteExcel,Spreadsheet:ParseExcel to the machine for writing a program which will retrieve data from an Excel Sheet. Can anyone explain me the steps to install Spreadsheet::WriteExcel,Spreadsheet:ParseExcel in Windows machine.
1
3232
by: tito | last post by:
Hi All, I am trying to write a code which will convert the Excel sheet document to Pie Diagarm using Perl Script.I have already searched in CPAN which gives the details of Spreadsheet::WriteExcel::Chart but not in greater details. Can anyone explain me how to do the same. Thanks
5
11060
by: rasmitasah25 | last post by:
hi, I am very new to perl.I have written a perl script which is writing data into an excel file.The problem is that it is creating one new excel file while executing but my need id to write into an existing .xls file. currently I am using: my $workbook = Spreadsheet::WriteExcel::Big->new("file.xls"); for that which method Should I use?? can anyone please help me... Thanks
6
1887
by: Sport Girl | last post by:
Hi all , i need to write into an excel sheet file the data retreived from the database. i have the script but the problem is that i can't get the data written in the excel file. Can anybody help pleeeassse. #!/usr/bin/perl use strict; use warnings; use DBI; use DBD::mysql;
5
2829
by: bvithya | last post by:
Hi Gurus, I am in need of your guidance. I have installed Perl5.8.8 on my server running with SunOS 5.8 and then I installed Spreadsheet::WriteExcel perl module. It has been installed successfully. Howver when I try to run a command to check whether it emails an excel sheet or not, it showed me the below. # /home/oracle8/oradba/admin/utils/sqlplus2xls/sqlplus2xls.pl ERROR (Missing Parameter): <config_file> not specified!
2
5413
by: RAGHAVENDRAS | last post by:
Hi, I am writing a script which should update an excel sheet daily. So how do I determine which is the last row which contains data and then write the latest data into the sheet. use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel; $datetime=localtime();
8
9415
by: Perl Beginner | last post by:
I am using Win32. I have created an excel spreadsheet, formatted the columns and rows, and would like to write to the cells…all of this using Spreadsheet::WriteExcel. My issue is, my script is very vast with a lot of subroutines, but I need the excel spreadsheet created in the main subroutine becasue this is where the data is that i want to capture. So if I create and format the spreadsheet within the main subroutine, and as it loops through,...
3
3199
by: somsub | last post by:
Hi, I m facing a problem to add an array as a comment to a MS excel cell using Spreadsheet :: WriteExcel . I m using the below code use Spreadsheet::WriteExcel; $workbook = Spreadsheet::WriteExcel->new('perl.xls'); $worksheet = $workbook->add_worksheet(); print "\n \n Enter a path value to take its contns \n";
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.