You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Chen Peng <ch...@gmail.com> on 2012/07/02 10:33:07 UTC

[DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Hi All,
      My name is Chen Peng, I am a developer from Symphony. My special
areas are VBA and sw.
      Now I found an issue about macros lost:
         I saved an excel file with VBA to spreadsheet, the VBA can work
well in spreadsheet, then I wanted to save this spreadsheet back to excel,
but all the macros are lost.
      I propose to save the binary data of excel VBA to spreadsheet, when
saving excel to spreadsheet, then we can get the binary data from
spreadsheet if need to save the spreadsheet to excel again.
      The binary data will not impact the open/save... of the ODF format
application, it will not be touched when we operate the ODF formant
applications. The binary data will be just used when we want to save the
spreadsheet to excel, it is just a data prestore about saving spreadsheet
macros to excel.
       Can you give some advice about the solution?
       Any feedback will be preciated, thanks.

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by chengjh <ch...@apache.org>.
Hi Rob,

On Tue, Jul 3, 2012 at 7:15 PM, Rob Weir <ro...@apache.org> wrote:

> On Mon, Jul 2, 2012 at 4:33 AM, Chen Peng <ch...@gmail.com> wrote:
> > Hi All,
> >       My name is Chen Peng, I am a developer from Symphony. My special
> > areas are VBA and sw.
> >       Now I found an issue about macros lost:
> >          I saved an excel file with VBA to spreadsheet, the VBA can work
> > well in spreadsheet, then I wanted to save this spreadsheet back to
> excel,
> > but all the macros are lost.
>
> How common is this scenario?   Wouldn't the more typical user action
> be to re-save the document back to XLS format?


a)It is a good question about the scenario,common or not..But I think Peng
wants to ask for comments about the technical solution.


> Isn't that what
> happens by default when they do a save when editing an XLS file? If
> the user does this, will the macro be saved correctly?
>
> b)When AOO Spreadsheet launches an xls file with VBA macros, the VBA
streams will have a copy in memory and simultaneously the VBA macros are
parsed into Spreadsheet VBA model, and end users can see and edit the VBA
macros in IDE. Be aware, the modifications will only be kept in Spreadsheet
VBA model, and will be lost when end users do saving[to xls], instead, the
copy of the VBA Streams in memory will be saved back.So,if end users open
the saved xls file in MS Excel,they will only see the original VBA macros.


> >       I propose to save the binary data of excel VBA to spreadsheet, when
> > saving excel to spreadsheet, then we can get the binary data from
> > spreadsheet if need to save the spreadsheet to excel again.
> >       The binary data will not impact the open/save... of the ODF format
> > application, it will not be touched when we operate the ODF formant
> > applications. The binary data will be just used when we want to save the
> > spreadsheet to excel, it is just a data prestore about saving spreadsheet
> > macros to excel.
> >        Can you give some advice about the solution?
> >        Any feedback will be preciated, thanks.
>



-- 

Best Regards,Jianhong Cheng

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by Rob Weir <ro...@apache.org>.
On Mon, Jul 2, 2012 at 4:33 AM, Chen Peng <ch...@gmail.com> wrote:
> Hi All,
>       My name is Chen Peng, I am a developer from Symphony. My special
> areas are VBA and sw.
>       Now I found an issue about macros lost:
>          I saved an excel file with VBA to spreadsheet, the VBA can work
> well in spreadsheet, then I wanted to save this spreadsheet back to excel,
> but all the macros are lost.

How common is this scenario?   Wouldn't the more typical user action
be to re-save the document back to XLS format?  Isn't that what
happens by default when they do a save when editing an XLS file? If
the user does this, will the macro be saved correctly?

>       I propose to save the binary data of excel VBA to spreadsheet, when
> saving excel to spreadsheet, then we can get the binary data from
> spreadsheet if need to save the spreadsheet to excel again.
>       The binary data will not impact the open/save... of the ODF format
> application, it will not be touched when we operate the ODF formant
> applications. The binary data will be just used when we want to save the
> spreadsheet to excel, it is just a data prestore about saving spreadsheet
> macros to excel.
>        Can you give some advice about the solution?
>        Any feedback will be preciated, thanks.

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by Chen Peng <ch...@gmail.com>.
Yes, Jim. Your description is very exact about this topic. Thank you.

2012/7/3 chengjh <ch...@apache.org>

> Hi Peng,
>
> Let me use a scenario to confirm your problem,solution and
> question..Anything misunderstood,please correct me.thanks.
>
> Problem:
> When AOO launches an excel document with VBA,saves to ods and then saves to
> excel again,the VBA info will be lost.
>
> Solution:
> a)The VBA streams of an excel document will be saved into the ods document
> with binary format when converting an excel document to an ods document in
> AOO Spreadsheet with certain controller.
> b)Once the ods document containing the binary VBA streams is launched into
> AOO or previous releases,with certain controller,the binary VBA steams will
> be loaded[still binary stream in memory] or rejected..There is no any
> impact on the application,the application can still work well.
> c)Based on b),if the ods document is saved to an excel document,the binary
> VBA streams will be exported, thus, the VBA info will not be lost.
>
> Question:
> You are not sure whether this solution is reasonable. So, you want to know
> the comments about your solution. If no comments, you will do so to
> implement it.
>
> On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com> wrote:
>
> > Hi All,
> >       My name is Chen Peng, I am a developer from Symphony. My special
> > areas are VBA and sw.
> >       Now I found an issue about macros lost:
> >          I saved an excel file with VBA to spreadsheet, the VBA can work
> > well in spreadsheet, then I wanted to save this spreadsheet back to
> excel,
> > but all the macros are lost.
> >       I propose to save the binary data of excel VBA to spreadsheet, when
> > saving excel to spreadsheet, then we can get the binary data from
> > spreadsheet if need to save the spreadsheet to excel again.
> >       The binary data will not impact the open/save... of the ODF format
> > application, it will not be touched when we operate the ODF formant
> > applications. The binary data will be just used when we want to save the
> > spreadsheet to excel, it is just a data prestore about saving spreadsheet
> > macros to excel.
> >        Can you give some advice about the solution?
> >        Any feedback will be preciated, thanks.
> >
>
>
>
> --
>
> Best Regards,Jianhong Cheng
>

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by Chen Peng <ch...@gmail.com>.
Comparing with xls-file, we lost VBA attributes when importing.
In xls-file, VBA macro is comprised by the source in IDE and related VBA
attributes.
We can't get the attributes from IDE in ods-file, we just can get the
source from IDE in ods-file.
Without those attributes we can't write the macro back to xls-file.

2012/7/3 Regina Henschel <rb...@t-online.de>

> Hi,
>
> chengjh schrieb:
>
> Hi Peng,
>>
>> Let me use a scenario to confirm your problem,solution and
>> question..Anything misunderstood,please correct me.thanks.
>>
>> Problem:
>> When AOO launches an excel document with VBA,saves to ods and then saves
>> to
>> excel again,the VBA info will be lost.
>>
>> Solution:
>> a)The VBA streams of an excel document will be saved into the ods document
>> with binary format when converting an excel document to an ods document in
>> AOO Spreadsheet with certain controller.
>> b)Once the ods document containing the binary VBA streams is launched into
>> AOO or previous releases,with certain controller,the binary VBA steams
>> will
>> be loaded[still binary stream in memory] or rejected..There is no any
>> impact on the application,the application can still work well.
>> c)Based on b),if the ods document is saved to an excel document,the binary
>> VBA streams will be exported, thus, the VBA info will not be lost.
>>
>
> I do not like the idea, that a binary code which I do not know what it
> does, will be shipped together with an ods-file. Because the source it
> editable in the IDE, the source and the binary might differ. The binary can
> be dangerous although the source looks harmless. I consider this a security
> problem.
>
> Currently the macro is lost, although the source is in the ods-file and
> commented as VBA macro. Isn't it possible, to write the macro back to
> xsl-file from this source?
>
> Kind regards
> Regina
>
>
>
>> Question:
>> You are not sure whether this solution is reasonable. So, you want to know
>> the comments about your solution. If no comments, you will do so to
>> implement it.
>>
>> On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com> wrote:
>>
>> Hi All,
>>>        My name is Chen Peng, I am a developer from Symphony. My special
>>> areas are VBA and sw.
>>>        Now I found an issue about macros lost:
>>>           I saved an excel file with VBA to spreadsheet, the VBA can work
>>> well in spreadsheet, then I wanted to save this spreadsheet back to
>>> excel,
>>> but all the macros are lost.
>>>        I propose to save the binary data of excel VBA to spreadsheet,
>>> when
>>> saving excel to spreadsheet, then we can get the binary data from
>>> spreadsheet if need to save the spreadsheet to excel again.
>>>        The binary data will not impact the open/save... of the ODF format
>>> application, it will not be touched when we operate the ODF formant
>>> applications. The binary data will be just used when we want to save the
>>> spreadsheet to excel, it is just a data prestore about saving spreadsheet
>>> macros to excel.
>>>         Can you give some advice about the solution?
>>>         Any feedback will be preciated, thanks.
>>>
>>>
>>
>>
>>
>
>

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by Regina Henschel <rb...@t-online.de>.
Hi,

chengjh schrieb:
> Hi Peng,
>
> Let me use a scenario to confirm your problem,solution and
> question..Anything misunderstood,please correct me.thanks.
>
> Problem:
> When AOO launches an excel document with VBA,saves to ods and then saves to
> excel again,the VBA info will be lost.
>
> Solution:
> a)The VBA streams of an excel document will be saved into the ods document
> with binary format when converting an excel document to an ods document in
> AOO Spreadsheet with certain controller.
> b)Once the ods document containing the binary VBA streams is launched into
> AOO or previous releases,with certain controller,the binary VBA steams will
> be loaded[still binary stream in memory] or rejected..There is no any
> impact on the application,the application can still work well.
> c)Based on b),if the ods document is saved to an excel document,the binary
> VBA streams will be exported, thus, the VBA info will not be lost.

I do not like the idea, that a binary code which I do not know what it 
does, will be shipped together with an ods-file. Because the source it 
editable in the IDE, the source and the binary might differ. The binary 
can be dangerous although the source looks harmless. I consider this a 
security problem.

Currently the macro is lost, although the source is in the ods-file and 
commented as VBA macro. Isn't it possible, to write the macro back to 
xsl-file from this source?

Kind regards
Regina

>
> Question:
> You are not sure whether this solution is reasonable. So, you want to know
> the comments about your solution. If no comments, you will do so to
> implement it.
>
> On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com> wrote:
>
>> Hi All,
>>        My name is Chen Peng, I am a developer from Symphony. My special
>> areas are VBA and sw.
>>        Now I found an issue about macros lost:
>>           I saved an excel file with VBA to spreadsheet, the VBA can work
>> well in spreadsheet, then I wanted to save this spreadsheet back to excel,
>> but all the macros are lost.
>>        I propose to save the binary data of excel VBA to spreadsheet, when
>> saving excel to spreadsheet, then we can get the binary data from
>> spreadsheet if need to save the spreadsheet to excel again.
>>        The binary data will not impact the open/save... of the ODF format
>> application, it will not be touched when we operate the ODF formant
>> applications. The binary data will be just used when we want to save the
>> spreadsheet to excel, it is just a data prestore about saving spreadsheet
>> macros to excel.
>>         Can you give some advice about the solution?
>>         Any feedback will be preciated, thanks.
>>
>
>
>



Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by zhangjf <zh...@apache.org>.
On Tue, Jul 3, 2012 at 10:22 PM, Lei Wang <le...@gmail.com> wrote:
> As I know, VBA code can be related with specific sheet. When end user open
> the ods file and remove this sheet, then save it as xls file.  According to
> your solution, all VBA codes will be restored in xls file. Is this xls file
> valid?
>

> Another concern is does your solution conform to ODF1.2 standard?
>

Just some thoughts.

About the ODF standard compliance, I think it depends on where this
piece of data is saved. odf supports to add user defined property or
customer meta data http://s.apache.org/CA0. Also you can refer to the
XDocumentProperties uno interface at http://s.apache.org/sW for the
API to get/set user defined properties, it even supports to add extra
data to odf package. In this way I don't think it breaks the ODF
standard. Then only interesting consumers read this piece of data,
others can safely ignore them.

Of course, these document seems a kind of odf extended documents.

Regards,
Zhangjf

> On Tue, Jul 3, 2012 at 6:32 PM, chengjh <ch...@apache.org> wrote:
>
>> That doesn't matter that you think they are VBA or Star Basic when saving a
>> xls with VBA as ods file..To some APIs with behavior difference,they will
>> be distinguished with the line "Option VBASupport 1" at the beginning..End
>> users can modify the Star Basic codes in AOO Spreadsheet,but all Star Basic
>> contents including original and modified will be lost when exporting to xls
>> file..Here,if the ods file is converted from a xls file based on Peng's
>> solution,the behavior is still kept unchanged...The only difference is that
>> the saved binary VBA streams within the ods file will be exported to the
>> xls file at that time.Thus,when end users launch the xls file in MS
>> Excel,the original VBA will be there.That's the expected result.thanks.
>>
>> On Tue, Jul 3, 2012 at 5:02 PM, Lei Wang <le...@gmail.com> wrote:
>>
>> > Jian Hong,
>> >
>> > Will AOO save VBA as Star Basic in ods file when saving a xls file with
>> VBA
>> > as ods file? If it is true, can user modify the Star Basic in the new ods
>> > file? What happened if user change the Star Basic in the ods file then
>> save
>> > as a xls file?
>> >
>> > On Tue, Jul 3, 2012 at 3:57 PM, chengjh <ch...@apache.org> wrote:
>> >
>> > > Hi Peng,
>> > >
>> > > Let me use a scenario to confirm your problem,solution and
>> > > question..Anything misunderstood,please correct me.thanks.
>> > >
>> > > Problem:
>> > > When AOO launches an excel document with VBA,saves to ods and then
>> saves
>> > to
>> > > excel again,the VBA info will be lost.
>> > >
>> > > Solution:
>> > > a)The VBA streams of an excel document will be saved into the ods
>> > document
>> > > with binary format when converting an excel document to an ods document
>> > in
>> > > AOO Spreadsheet with certain controller.
>> > > b)Once the ods document containing the binary VBA streams is launched
>> > into
>> > > AOO or previous releases,with certain controller,the binary VBA steams
>> > will
>> > > be loaded[still binary stream in memory] or rejected..There is no any
>> > > impact on the application,the application can still work well.
>> > > c)Based on b),if the ods document is saved to an excel document,the
>> > binary
>> > > VBA streams will be exported, thus, the VBA info will not be lost.
>> > >
>> > > Question:
>> > > You are not sure whether this solution is reasonable. So, you want to
>> > know
>> > > the comments about your solution. If no comments, you will do so to
>> > > implement it.
>> > >
>> > > On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com>
>> > wrote:
>> > >
>> > > > Hi All,
>> > > >       My name is Chen Peng, I am a developer from Symphony. My
>> special
>> > > > areas are VBA and sw.
>> > > >       Now I found an issue about macros lost:
>> > > >          I saved an excel file with VBA to spreadsheet, the VBA can
>> > work
>> > > > well in spreadsheet, then I wanted to save this spreadsheet back to
>> > > excel,
>> > > > but all the macros are lost.
>> > > >       I propose to save the binary data of excel VBA to spreadsheet,
>> > when
>> > > > saving excel to spreadsheet, then we can get the binary data from
>> > > > spreadsheet if need to save the spreadsheet to excel again.
>> > > >       The binary data will not impact the open/save... of the ODF
>> > format
>> > > > application, it will not be touched when we operate the ODF formant
>> > > > applications. The binary data will be just used when we want to save
>> > the
>> > > > spreadsheet to excel, it is just a data prestore about saving
>> > spreadsheet
>> > > > macros to excel.
>> > > >        Can you give some advice about the solution?
>> > > >        Any feedback will be preciated, thanks.
>> > > >
>> > >
>> > >
>> > >
>> > > --
>> > >
>> > > Best Regards,Jianhong Cheng
>> > >
>> >
>>
>>
>>
>> --
>>
>> Best Regards,Jianhong Cheng
>>

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by Lei Wang <le...@gmail.com>.
As I know, VBA code can be related with specific sheet. When end user open
the ods file and remove this sheet, then save it as xls file.  According to
your solution, all VBA codes will be restored in xls file. Is this xls file
valid?

Another concern is does your solution conform to ODF1.2 standard?

On Tue, Jul 3, 2012 at 6:32 PM, chengjh <ch...@apache.org> wrote:

> That doesn't matter that you think they are VBA or Star Basic when saving a
> xls with VBA as ods file..To some APIs with behavior difference,they will
> be distinguished with the line "Option VBASupport 1" at the beginning..End
> users can modify the Star Basic codes in AOO Spreadsheet,but all Star Basic
> contents including original and modified will be lost when exporting to xls
> file..Here,if the ods file is converted from a xls file based on Peng's
> solution,the behavior is still kept unchanged...The only difference is that
> the saved binary VBA streams within the ods file will be exported to the
> xls file at that time.Thus,when end users launch the xls file in MS
> Excel,the original VBA will be there.That's the expected result.thanks.
>
> On Tue, Jul 3, 2012 at 5:02 PM, Lei Wang <le...@gmail.com> wrote:
>
> > Jian Hong,
> >
> > Will AOO save VBA as Star Basic in ods file when saving a xls file with
> VBA
> > as ods file? If it is true, can user modify the Star Basic in the new ods
> > file? What happened if user change the Star Basic in the ods file then
> save
> > as a xls file?
> >
> > On Tue, Jul 3, 2012 at 3:57 PM, chengjh <ch...@apache.org> wrote:
> >
> > > Hi Peng,
> > >
> > > Let me use a scenario to confirm your problem,solution and
> > > question..Anything misunderstood,please correct me.thanks.
> > >
> > > Problem:
> > > When AOO launches an excel document with VBA,saves to ods and then
> saves
> > to
> > > excel again,the VBA info will be lost.
> > >
> > > Solution:
> > > a)The VBA streams of an excel document will be saved into the ods
> > document
> > > with binary format when converting an excel document to an ods document
> > in
> > > AOO Spreadsheet with certain controller.
> > > b)Once the ods document containing the binary VBA streams is launched
> > into
> > > AOO or previous releases,with certain controller,the binary VBA steams
> > will
> > > be loaded[still binary stream in memory] or rejected..There is no any
> > > impact on the application,the application can still work well.
> > > c)Based on b),if the ods document is saved to an excel document,the
> > binary
> > > VBA streams will be exported, thus, the VBA info will not be lost.
> > >
> > > Question:
> > > You are not sure whether this solution is reasonable. So, you want to
> > know
> > > the comments about your solution. If no comments, you will do so to
> > > implement it.
> > >
> > > On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com>
> > wrote:
> > >
> > > > Hi All,
> > > >       My name is Chen Peng, I am a developer from Symphony. My
> special
> > > > areas are VBA and sw.
> > > >       Now I found an issue about macros lost:
> > > >          I saved an excel file with VBA to spreadsheet, the VBA can
> > work
> > > > well in spreadsheet, then I wanted to save this spreadsheet back to
> > > excel,
> > > > but all the macros are lost.
> > > >       I propose to save the binary data of excel VBA to spreadsheet,
> > when
> > > > saving excel to spreadsheet, then we can get the binary data from
> > > > spreadsheet if need to save the spreadsheet to excel again.
> > > >       The binary data will not impact the open/save... of the ODF
> > format
> > > > application, it will not be touched when we operate the ODF formant
> > > > applications. The binary data will be just used when we want to save
> > the
> > > > spreadsheet to excel, it is just a data prestore about saving
> > spreadsheet
> > > > macros to excel.
> > > >        Can you give some advice about the solution?
> > > >        Any feedback will be preciated, thanks.
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > Best Regards,Jianhong Cheng
> > >
> >
>
>
>
> --
>
> Best Regards,Jianhong Cheng
>

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by chengjh <ch...@apache.org>.
That doesn't matter that you think they are VBA or Star Basic when saving a
xls with VBA as ods file..To some APIs with behavior difference,they will
be distinguished with the line "Option VBASupport 1" at the beginning..End
users can modify the Star Basic codes in AOO Spreadsheet,but all Star Basic
contents including original and modified will be lost when exporting to xls
file..Here,if the ods file is converted from a xls file based on Peng's
solution,the behavior is still kept unchanged...The only difference is that
the saved binary VBA streams within the ods file will be exported to the
xls file at that time.Thus,when end users launch the xls file in MS
Excel,the original VBA will be there.That's the expected result.thanks.

On Tue, Jul 3, 2012 at 5:02 PM, Lei Wang <le...@gmail.com> wrote:

> Jian Hong,
>
> Will AOO save VBA as Star Basic in ods file when saving a xls file with VBA
> as ods file? If it is true, can user modify the Star Basic in the new ods
> file? What happened if user change the Star Basic in the ods file then save
> as a xls file?
>
> On Tue, Jul 3, 2012 at 3:57 PM, chengjh <ch...@apache.org> wrote:
>
> > Hi Peng,
> >
> > Let me use a scenario to confirm your problem,solution and
> > question..Anything misunderstood,please correct me.thanks.
> >
> > Problem:
> > When AOO launches an excel document with VBA,saves to ods and then saves
> to
> > excel again,the VBA info will be lost.
> >
> > Solution:
> > a)The VBA streams of an excel document will be saved into the ods
> document
> > with binary format when converting an excel document to an ods document
> in
> > AOO Spreadsheet with certain controller.
> > b)Once the ods document containing the binary VBA streams is launched
> into
> > AOO or previous releases,with certain controller,the binary VBA steams
> will
> > be loaded[still binary stream in memory] or rejected..There is no any
> > impact on the application,the application can still work well.
> > c)Based on b),if the ods document is saved to an excel document,the
> binary
> > VBA streams will be exported, thus, the VBA info will not be lost.
> >
> > Question:
> > You are not sure whether this solution is reasonable. So, you want to
> know
> > the comments about your solution. If no comments, you will do so to
> > implement it.
> >
> > On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com>
> wrote:
> >
> > > Hi All,
> > >       My name is Chen Peng, I am a developer from Symphony. My special
> > > areas are VBA and sw.
> > >       Now I found an issue about macros lost:
> > >          I saved an excel file with VBA to spreadsheet, the VBA can
> work
> > > well in spreadsheet, then I wanted to save this spreadsheet back to
> > excel,
> > > but all the macros are lost.
> > >       I propose to save the binary data of excel VBA to spreadsheet,
> when
> > > saving excel to spreadsheet, then we can get the binary data from
> > > spreadsheet if need to save the spreadsheet to excel again.
> > >       The binary data will not impact the open/save... of the ODF
> format
> > > application, it will not be touched when we operate the ODF formant
> > > applications. The binary data will be just used when we want to save
> the
> > > spreadsheet to excel, it is just a data prestore about saving
> spreadsheet
> > > macros to excel.
> > >        Can you give some advice about the solution?
> > >        Any feedback will be preciated, thanks.
> > >
> >
> >
> >
> > --
> >
> > Best Regards,Jianhong Cheng
> >
>



-- 

Best Regards,Jianhong Cheng

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by Lei Wang <le...@gmail.com>.
Jian Hong,

Will AOO save VBA as Star Basic in ods file when saving a xls file with VBA
as ods file? If it is true, can user modify the Star Basic in the new ods
file? What happened if user change the Star Basic in the ods file then save
as a xls file?

On Tue, Jul 3, 2012 at 3:57 PM, chengjh <ch...@apache.org> wrote:

> Hi Peng,
>
> Let me use a scenario to confirm your problem,solution and
> question..Anything misunderstood,please correct me.thanks.
>
> Problem:
> When AOO launches an excel document with VBA,saves to ods and then saves to
> excel again,the VBA info will be lost.
>
> Solution:
> a)The VBA streams of an excel document will be saved into the ods document
> with binary format when converting an excel document to an ods document in
> AOO Spreadsheet with certain controller.
> b)Once the ods document containing the binary VBA streams is launched into
> AOO or previous releases,with certain controller,the binary VBA steams will
> be loaded[still binary stream in memory] or rejected..There is no any
> impact on the application,the application can still work well.
> c)Based on b),if the ods document is saved to an excel document,the binary
> VBA streams will be exported, thus, the VBA info will not be lost.
>
> Question:
> You are not sure whether this solution is reasonable. So, you want to know
> the comments about your solution. If no comments, you will do so to
> implement it.
>
> On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com> wrote:
>
> > Hi All,
> >       My name is Chen Peng, I am a developer from Symphony. My special
> > areas are VBA and sw.
> >       Now I found an issue about macros lost:
> >          I saved an excel file with VBA to spreadsheet, the VBA can work
> > well in spreadsheet, then I wanted to save this spreadsheet back to
> excel,
> > but all the macros are lost.
> >       I propose to save the binary data of excel VBA to spreadsheet, when
> > saving excel to spreadsheet, then we can get the binary data from
> > spreadsheet if need to save the spreadsheet to excel again.
> >       The binary data will not impact the open/save... of the ODF format
> > application, it will not be touched when we operate the ODF formant
> > applications. The binary data will be just used when we want to save the
> > spreadsheet to excel, it is just a data prestore about saving spreadsheet
> > macros to excel.
> >        Can you give some advice about the solution?
> >        Any feedback will be preciated, thanks.
> >
>
>
>
> --
>
> Best Regards,Jianhong Cheng
>

Re: [DISCUSS]Macros are lost after saving the xls file to ods, then save as to xls again

Posted by chengjh <ch...@apache.org>.
Hi Peng,

Let me use a scenario to confirm your problem,solution and
question..Anything misunderstood,please correct me.thanks.

Problem:
When AOO launches an excel document with VBA,saves to ods and then saves to
excel again,the VBA info will be lost.

Solution:
a)The VBA streams of an excel document will be saved into the ods document
with binary format when converting an excel document to an ods document in
AOO Spreadsheet with certain controller.
b)Once the ods document containing the binary VBA streams is launched into
AOO or previous releases,with certain controller,the binary VBA steams will
be loaded[still binary stream in memory] or rejected..There is no any
impact on the application,the application can still work well.
c)Based on b),if the ods document is saved to an excel document,the binary
VBA streams will be exported, thus, the VBA info will not be lost.

Question:
You are not sure whether this solution is reasonable. So, you want to know
the comments about your solution. If no comments, you will do so to
implement it.

On Mon, Jul 2, 2012 at 4:33 PM, Chen Peng <ch...@gmail.com> wrote:

> Hi All,
>       My name is Chen Peng, I am a developer from Symphony. My special
> areas are VBA and sw.
>       Now I found an issue about macros lost:
>          I saved an excel file with VBA to spreadsheet, the VBA can work
> well in spreadsheet, then I wanted to save this spreadsheet back to excel,
> but all the macros are lost.
>       I propose to save the binary data of excel VBA to spreadsheet, when
> saving excel to spreadsheet, then we can get the binary data from
> spreadsheet if need to save the spreadsheet to excel again.
>       The binary data will not impact the open/save... of the ODF format
> application, it will not be touched when we operate the ODF formant
> applications. The binary data will be just used when we want to save the
> spreadsheet to excel, it is just a data prestore about saving spreadsheet
> macros to excel.
>        Can you give some advice about the solution?
>        Any feedback will be preciated, thanks.
>



-- 

Best Regards,Jianhong Cheng