Writing 2007 Excel File
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2010
11:06 AM
06-30-2010
11:06 AM
Writing 2007 Excel File
I am creating an excel file with test data and am using that for validation.
I have Office 2007 installed giving me a default 2007 format when I write my file. When I go to read the file with Java, it has problems recognizing a 2007 Excel but not a 2003. Is there an option to write the Excel in 2003?
...
xclD = Sys.OleObject("Excel.Application");
workBkDarwin = xclD.Workbooks.Add();
workSheetEvent = workBkDarwin.Sheets.Add();
workSheetEvent.Name = "Event";
...
When executing the OleObject or workbook, can I tell it to create in 2003 format?
I have Office 2007 installed giving me a default 2007 format when I write my file. When I go to read the file with Java, it has problems recognizing a 2007 Excel but not a 2003. Is there an option to write the Excel in 2003?
...
xclD = Sys.OleObject("Excel.Application");
workBkDarwin = xclD.Workbooks.Add();
workSheetEvent = workBkDarwin.Sheets.Add();
workSheetEvent.Name = "Event";
...
When executing the OleObject or workbook, can I tell it to create in 2003 format?
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2010
10:49 PM
06-30-2010
10:49 PM
Hi,
When saving your document, use the SaveAs method and specify the format you need.
When saving your document, use the SaveAs method and specify the format you need.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2010
03:46 AM
07-01-2010
03:46 AM
Looks like the second option is SaveAs is XlFileFormat which designates the file format.
How do we access the enumeration for the file format option?
xcl = Sys.OleObject("Excel.Application");
workb = xcl.Workbooks.Add();
...
// I tried
var ff = Sys.OleObject("Excel.XlFileFormat.xlAddIn");
workb.SaveAs("myWork.xcl",ff);
// But got an error that it could not find class.
Thanks
How do we access the enumeration for the file format option?
xcl = Sys.OleObject("Excel.Application");
workb = xcl.Workbooks.Add();
...
// I tried
var ff = Sys.OleObject("Excel.XlFileFormat.xlAddIn");
workb.SaveAs("myWork.xcl",ff);
// But got an error that it could not find class.
Thanks
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2010
08:15 PM
07-01-2010
08:15 PM
Hi,
In the MSDN article I referred to, there's a link to available XlFileFormat constants with their numeric values. You need to use numbers, not names constants, since they're not available outside Excel.
In the MSDN article I referred to, there's a link to available XlFileFormat constants with their numeric values. You need to use numbers, not names constants, since they're not available outside Excel.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
