473,748 Members | 2,602 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 3783
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
7377
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
14704
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
3237
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
11065
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
1890
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
2833
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
5420
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
9429
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
3202
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
9530
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
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
9312
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
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4593
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
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
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.