You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Veena Sarolkar <sa...@extenprise.com> on 2005/04/02 09:21:44 UTC

Reading Excel 3.0 format file

Hi All,

I am very new to this forum. But I read the documentaion & came to know that
we can use HSSF to read & write Excel files.
But it only supports reading Excel file format of Excel 97.
Is there any way to read Excel 3.0 file. I have Excel 3.0 file & as I am
getting it from one URL i cannot use save as to save it in different format.
Or is there any way to convert this file to Excel 97 programmatically?
Please help me. This is very urgent.

Regards,
Veena



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Reading Excel 3.0 format file

Posted by Sanjiv Jivan <sa...@gmail.com>.
Cool. Although using a COM interface is probably more appropriate in
your case, I did find a way to execute the conversion code via a
script. This might be beneficial for others with similar needs.

A recent mail prompted me to explore using Windows VB scripting
support to accomplish this.

Create a file called convert.vbs with the following contents :

Dim objexcel
Set objExcel = createobject("Excel.Application")
objExcel.Workbooks.Open("<path to excel 3>")
objexcel.ActiveWorkbook.SaveAs("C:\convert\excel-97.xls")
objexcel.Quit

Execute the script from command line by calling 

C:\temp>cscript convert.vbs

Regards,
Sanjiv

On 4/4/05, Veena Sarolkar <sa...@extenprise.com> wrote:
> Hi Sanjeev,
> 
> Thanks a lot  for ur help. I wrote COM interface & converted my Excel file.
> Thanks.
> 
> Veena
> 
> -----Original Message-----
> From: Sanjiv Jivan [mailto:sanjiv.jivan@gmail.com]
> Sent: Saturday, April 02, 2005 1:18 PM
> To: POI Users List
> Subject: Re: Reading Excel 3.0 format file
> 
> You can't do this in Java. Since you need some way of automating this
> conversion, I would create a small VB executable that accomplishes the
> equivalent of the VBA code that I posted. (I'm not aware of a way to
> execute VBA code through a shell command ).
> 
> Just do a Google search on how to write VB code to access MS Excel
> functionality. Here's a link to get you started
> 
> http://www.vb-helper.com/howto_excel_write.html
> 
> Sanjiv
> 
> On Apr 2, 2005 2:44 AM, Veena Sarolkar <sa...@extenprise.com>
> wrote:
> > Thanks a lot Sanjiv.
> > But will you please tell me how to write this in Java?Will it need some
> jar
> > or what?
> >
> > Regards,
> > Veena
> >
> > -----Original Message-----
> > From: Sanjiv Jivan [mailto:sanjiv.jivan@gmail.com]
> > Sent: Saturday, April 02, 2005 1:00 PM
> > To: POI Users List
> > Subject: Re: Reading Excel 3.0 format file
> >
> > The following VBA code should do it..
> >
> >     Workbooks.Open Filename:="C:\<path to Excel 3 file>"
> >     ActiveWorkbook.SaveAs Filename:= _
> >         "C:\convert\excel-97.xls", FileFormat:=xlNormal _
> >         , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
> _
> >         CreateBackup:=False
> >
> > Hope this helps,
> > Sanjiv
> >
> > On Apr 2, 2005 2:21 AM, Veena Sarolkar <sa...@extenprise.com>
> > wrote:
> > >
> > > Hi All,
> > >
> > > I am very new to this forum. But I read the documentaion & came to know
> > that
> > > we can use HSSF to read & write Excel files.
> > > But it only supports reading Excel file format of Excel 97.
> > > Is there any way to read Excel 3.0 file. I have Excel 3.0 file & as I am
> > > getting it from one URL i cannot use save as to save it in different
> > format.
> > > Or is there any way to convert this file to Excel 97 programmatically?
> > > Please help me. This is very urgent.
> > >
> > > Regards,
> > > Veena
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Reading Excel 3.0 format file

Posted by Veena Sarolkar <sa...@extenprise.com>.
Hi Sanjeev,

Thanks a lot  for ur help. I wrote COM interface & converted my Excel file.
Thanks.

Veena

-----Original Message-----
From: Sanjiv Jivan [mailto:sanjiv.jivan@gmail.com]
Sent: Saturday, April 02, 2005 1:18 PM
To: POI Users List
Subject: Re: Reading Excel 3.0 format file


You can't do this in Java. Since you need some way of automating this
conversion, I would create a small VB executable that accomplishes the
equivalent of the VBA code that I posted. (I'm not aware of a way to
execute VBA code through a shell command ).

Just do a Google search on how to write VB code to access MS Excel
functionality. Here's a link to get you started

http://www.vb-helper.com/howto_excel_write.html

Sanjiv

On Apr 2, 2005 2:44 AM, Veena Sarolkar <sa...@extenprise.com>
wrote:
> Thanks a lot Sanjiv.
> But will you please tell me how to write this in Java?Will it need some
jar
> or what?
>
> Regards,
> Veena
>
> -----Original Message-----
> From: Sanjiv Jivan [mailto:sanjiv.jivan@gmail.com]
> Sent: Saturday, April 02, 2005 1:00 PM
> To: POI Users List
> Subject: Re: Reading Excel 3.0 format file
>
> The following VBA code should do it..
>
>     Workbooks.Open Filename:="C:\<path to Excel 3 file>"
>     ActiveWorkbook.SaveAs Filename:= _
>         "C:\convert\excel-97.xls", FileFormat:=xlNormal _
>         , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
_
>         CreateBackup:=False
>
> Hope this helps,
> Sanjiv
>
> On Apr 2, 2005 2:21 AM, Veena Sarolkar <sa...@extenprise.com>
> wrote:
> >
> > Hi All,
> >
> > I am very new to this forum. But I read the documentaion & came to know
> that
> > we can use HSSF to read & write Excel files.
> > But it only supports reading Excel file format of Excel 97.
> > Is there any way to read Excel 3.0 file. I have Excel 3.0 file & as I am
> > getting it from one URL i cannot use save as to save it in different
> format.
> > Or is there any way to convert this file to Excel 97 programmatically?
> > Please help me. This is very urgent.
> >
> > Regards,
> > Veena
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Reading Excel 3.0 format file

Posted by Sanjiv Jivan <sa...@gmail.com>.
You can't do this in Java. Since you need some way of automating this
conversion, I would create a small VB executable that accomplishes the
equivalent of the VBA code that I posted. (I'm not aware of a way to
execute VBA code through a shell command ).

Just do a Google search on how to write VB code to access MS Excel
functionality. Here's a link to get you started

http://www.vb-helper.com/howto_excel_write.html

Sanjiv

On Apr 2, 2005 2:44 AM, Veena Sarolkar <sa...@extenprise.com> wrote:
> Thanks a lot Sanjiv.
> But will you please tell me how to write this in Java?Will it need some jar
> or what?
> 
> Regards,
> Veena
> 
> -----Original Message-----
> From: Sanjiv Jivan [mailto:sanjiv.jivan@gmail.com]
> Sent: Saturday, April 02, 2005 1:00 PM
> To: POI Users List
> Subject: Re: Reading Excel 3.0 format file
> 
> The following VBA code should do it..
> 
>     Workbooks.Open Filename:="C:\<path to Excel 3 file>"
>     ActiveWorkbook.SaveAs Filename:= _
>         "C:\convert\excel-97.xls", FileFormat:=xlNormal _
>         , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
>         CreateBackup:=False
> 
> Hope this helps,
> Sanjiv
> 
> On Apr 2, 2005 2:21 AM, Veena Sarolkar <sa...@extenprise.com>
> wrote:
> >
> > Hi All,
> >
> > I am very new to this forum. But I read the documentaion & came to know
> that
> > we can use HSSF to read & write Excel files.
> > But it only supports reading Excel file format of Excel 97.
> > Is there any way to read Excel 3.0 file. I have Excel 3.0 file & as I am
> > getting it from one URL i cannot use save as to save it in different
> format.
> > Or is there any way to convert this file to Excel 97 programmatically?
> > Please help me. This is very urgent.
> >
> > Regards,
> > Veena
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


RE: Reading Excel 3.0 format file

Posted by Veena Sarolkar <sa...@extenprise.com>.
Thanks a lot Sanjiv.
But will you please tell me how to write this in Java?Will it need some jar
or what?

Regards,
Veena

-----Original Message-----
From: Sanjiv Jivan [mailto:sanjiv.jivan@gmail.com]
Sent: Saturday, April 02, 2005 1:00 PM
To: POI Users List
Subject: Re: Reading Excel 3.0 format file


The following VBA code should do it..

    Workbooks.Open Filename:="C:\<path to Excel 3 file>"
    ActiveWorkbook.SaveAs Filename:= _
        "C:\convert\excel-97.xls", FileFormat:=xlNormal _
        , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
        CreateBackup:=False

Hope this helps,
Sanjiv

On Apr 2, 2005 2:21 AM, Veena Sarolkar <sa...@extenprise.com>
wrote:
>
> Hi All,
>
> I am very new to this forum. But I read the documentaion & came to know
that
> we can use HSSF to read & write Excel files.
> But it only supports reading Excel file format of Excel 97.
> Is there any way to read Excel 3.0 file. I have Excel 3.0 file & as I am
> getting it from one URL i cannot use save as to save it in different
format.
> Or is there any way to convert this file to Excel 97 programmatically?
> Please help me. This is very urgent.
>
> Regards,
> Veena
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: Reading Excel 3.0 format file

Posted by Sanjiv Jivan <sa...@gmail.com>.
The following VBA code should do it..

    Workbooks.Open Filename:="C:\<path to Excel 3 file>"
    ActiveWorkbook.SaveAs Filename:= _
        "C:\convert\excel-97.xls", FileFormat:=xlNormal _
        , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
        CreateBackup:=False

Hope this helps,
Sanjiv

On Apr 2, 2005 2:21 AM, Veena Sarolkar <sa...@extenprise.com> wrote:
> 
> Hi All,
> 
> I am very new to this forum. But I read the documentaion & came to know that
> we can use HSSF to read & write Excel files.
> But it only supports reading Excel file format of Excel 97.
> Is there any way to read Excel 3.0 file. I have Excel 3.0 file & as I am
> getting it from one URL i cannot use save as to save it in different format.
> Or is there any way to convert this file to Excel 97 programmatically?
> Please help me. This is very urgent.
> 
> Regards,
> Veena
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/