473,394 Members | 1,734 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,394 software developers and data experts.

Not able to open excel sheet created by Spreadsheet::WriteExcel .

16
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 3746
numberwhun
3,509 Expert Mod 2GB
@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
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 Expert Mod 2GB
@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
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 Expert Mod 2GB
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 Expert Mod 512MB
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
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
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 =...
4
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...
1
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...
5
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...
6
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...
5
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...
2
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...
8
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...
3
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 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.