If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem using SaveAs method
Hi,
I'm running a perl script which uses Win 32 OLE package for Excel operations. The script does some processing and populates a spreadsheet, after which it uses the 'SaveAs' method to save it as xls in the same folder in which the tool runs. This used to work fine until recently I upgraded from MS Office 2003 to MS Office 2007 version 12.0.6524.5003. Now, the script does not produce any xlsx file at all. I tried the same on another machine running Excel 2007 version 12.0.4518.1014, and surprisingly it generated the xlsx. Is this some known issue with this version of Excel ? Pls suggest what needs to be done.....I need to get this sorted very urgently. |
#2
|
|||
|
|||
Problem using SaveAs method
Check your setting in the Save section of Office/Excel Options -- the file
format you specify to save files in determines the default file type. Ensure that's xlsx (or xlsm). "Sujata" wrote: Hi, I'm running a perl script which uses Win 32 OLE package for Excel operations. The script does some processing and populates a spreadsheet, after which it uses the 'SaveAs' method to save it as xls in the same folder in which the tool runs. This used to work fine until recently I upgraded from MS Office 2003 to MS Office 2007 version 12.0.6524.5003. Now, the script does not produce any xlsx file at all. I tried the same on another machine running Excel 2007 version 12.0.4518.1014, and surprisingly it generated the xlsx. Is this some known issue with this version of Excel ? Pls suggest what needs to be done.....I need to get this sorted very urgently. |
#3
|
|||
|
|||
Problem using SaveAs method
Check out this link perhaps...
http://www.rondebruin.nl/saveas.htm -- HTH... Jim Thomlinson "Sujata" wrote: Hi, I'm running a perl script which uses Win 32 OLE package for Excel operations. The script does some processing and populates a spreadsheet, after which it uses the 'SaveAs' method to save it as xls in the same folder in which the tool runs. This used to work fine until recently I upgraded from MS Office 2003 to MS Office 2007 version 12.0.6524.5003. Now, the script does not produce any xlsx file at all. I tried the same on another machine running Excel 2007 version 12.0.4518.1014, and surprisingly it generated the xlsx. Is this some known issue with this version of Excel ? Pls suggest what needs to be done.....I need to get this sorted very urgently. |
#4
|
|||
|
|||
Problem using SaveAs method
In the SaveAs method, I tried specifiying the destination file extension
(xlsx - for excel version greater than 11.0 , and xls - for 11.0 and below versions ) along with the respective fileformat parameters (51 & 56) . But , it still fails to generate the xlsx document with Office 2007 version 12.0.6524.5003. Pls advise. Thanks, Sujata "Jim Thomlinson" wrote: Check out this link perhaps... http://www.rondebruin.nl/saveas.htm -- HTH... Jim Thomlinson "Sujata" wrote: Hi, I'm running a perl script which uses Win 32 OLE package for Excel operations. The script does some processing and populates a spreadsheet, after which it uses the 'SaveAs' method to save it as xls in the same folder in which the tool runs. This used to work fine until recently I upgraded from MS Office 2003 to MS Office 2007 version 12.0.6524.5003. Now, the script does not produce any xlsx file at all. I tried the same on another machine running Excel 2007 version 12.0.4518.1014, and surprisingly it generated the xlsx. Is this some known issue with this version of Excel ? Pls suggest what needs to be done.....I need to get this sorted very urgently. |
#5
|
|||
|
|||
Problem using SaveAs method
Went through the link : link : http://www.rondebruin.nl/saveas.htm
The syntax - ActiveWorkbook.SaveAs "C:\ron.xlsm", fileformat:=52 - cannot be directly used in my case as I'm using Win32 OLE in Perl. Below is a code snippet from my perl script. use Win32::OLE; $excel = new Win32::OLE('Excel.Application', \&XLS_QuitApp); $workbook = $excel-Workbooks-Add(); $workbook-SaveAs({FileName = $xls, FileFormat = 51}); I've tried doing a SaveAs with FileFormat 51 , but it fails to create an xlsx. Even experimented with other fileformats like : 56 (xlEccel8), -4143 (xlNormal) and 50 (xlExel12)), but none of them worked. Is it that the way I'm using OLE in Perl will no longer work for Excel 2007 ? Will I need to start using a completely different package to support my script on Office 2007 (for Excel 2007 ) ? I'm looking for immediate help in this direction. Can you pls advise ? "Sujata" wrote: In the SaveAs method, I tried specifiying the destination file extension (xlsx - for excel version greater than 11.0 , and xls - for 11.0 and below versions ) along with the respective fileformat parameters (51 & 56) . But , it still fails to generate the xlsx document with Office 2007 version 12.0.6524.5003. Pls advise. Thanks, Sujata "Jim Thomlinson" wrote: Check out this link perhaps... http://www.rondebruin.nl/saveas.htm -- HTH... Jim Thomlinson "Sujata" wrote: Hi, I'm running a perl script which uses Win 32 OLE package for Excel operations. The script does some processing and populates a spreadsheet, after which it uses the 'SaveAs' method to save it as xls in the same folder in which the tool runs. This used to work fine until recently I upgraded from MS Office 2003 to MS Office 2007 version 12.0.6524.5003. Now, the script does not produce any xlsx file at all. I tried the same on another machine running Excel 2007 version 12.0.4518.1014, and surprisingly it generated the xlsx. Is this some known issue with this version of Excel ? Pls suggest what needs to be done.....I need to get this sorted very urgently. |
Thread Tools | |
Display Modes | |
|
|