You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "C.Y. CHEN" <ic...@gmail.com> on 2012/12/06 22:42:57 UTC

How to Commit "Update of a Cell Value" in Existing .xls file to Trigger built-in Macro

Can anyone give me a quick pointer as to whether the following requirement
can be achieved via existing poi ss API?

I have a .xls file that consists of 1 macro.  The macro will be executed
upon the update of a cell value.
I would like to write a java program to iterate through a list of input
values to a particular cell that will trigger the built-in MACRO that in
turn will update the existing sheet.

Specifically, this is what I want to do and I will just need to fill in the
blank.

Step 1:  Get input value and feed to the target cell and simulate "press
enter" to trigger macro to update the entire sheet.
Step 2:  Upon sheet being updated, save the workbook to local file system.
Step 3:  Repeat step 1.

I think the unknowns to me is whether I can implement step 1 via POI API.
 I will need to load the .xls file and update the input string value to the
target cell and activate a dummy or empty cell to force the macro to be
triggered.

Your input is deeply appreciated!

Regards,
C.Y.

Re: How to Commit "Update of a Cell Value" in Existing .xls file to Trigger built-in Macro

Posted by Nick Burch <ni...@apache.org>.
On 06/12/12 22:15, C.Y. CHEN wrote:
> I can volunteer to do some research on this.  Is there any spec available
> from Microsoft?

For the older OLE2 formats, the documentation is all available from
http://msdn.microsoft.com/en-us/library/cc313105%28v=office.12%29.aspx

You'll probably want to read some of the introductions from 
http://msdn.microsoft.com/en-us/library/cc313118%28v=office.12%29.aspx 
to learn a bit about how it all fits together, and the language they 
use, before diving into the one or two documents that cover what you need

For the OOXML formats, you'd want ECMA-376 
http://www.ecma-international.org/publications/standards/Ecma-376.htm

Nick


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: How to Commit "Update of a Cell Value" in Existing .xls file to Trigger built-in Macro

Posted by "C.Y. CHEN" <ic...@gmail.com>.
I can volunteer to do some research on this.  Is there any spec available
from Microsoft?


On Thu, Dec 6, 2012 at 2:09 PM, Nick Burch <ap...@gagravarr.org> wrote:

> On Thu, 6 Dec 2012, C.Y. CHEN wrote:
>
>> Apache POI doesn't support running office macros, nor changing them
>>>
>>
>> Thanks for the quick reply.  Any plan of supporting it in the roadmap?
>>
>
> Unlikely, unless someone comes along and volunteers to do it!
>
>
>  Actually, I think my question may have been misleading.  Is it possible to
>> just update the cell value of a running .xls instance?
>>
>
> Nope, windows is very protective of open files... POI will happily let you
> write changes to cell values, but most likely you'll need to tell excel to
> open the file afterwards for your use case
>
>
> Nick
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
> For additional commands, e-mail: user-help@poi.apache.org
>
>


-- 
Faye Carlson Team strives to surpass your expectations, please let us know
if we ever fall short of our mission.


Regards,
C.Y. Chen
陳玉嶙
Broker Associate
The Faye Carlson Team
Tel: +1-510-771-7809
Fax: +1-866-863-3289
BB# 8991262099

China 中國辦公室:
電話 1:   95040314583
電話 2:   4006-805-969 (再撥分機號碼 8991262099#)
電話 3:   4006-438-114 (再撥分機號碼 8991262099#)

Taipei 台北辦公室 (璽福建設--董事長特助):
直撥專線: (02) 5594-4959
電話 1: (02) 40660660 (再撥分機號碼 8991262099#)
電話 2: (02) 40502999 (再撥分機號碼 8991262099#)

Email: iching6@gmail.com
CA DRE # 01827849

「貧寒的家境,以及在惡劣條件下的創業經驗,使我年輕時就深刻體會到,先天環境的好壞不足喜,亦不足憂,成功的關鍵完全在於一己的努力」-- 王永慶

Re: How to Commit "Update of a Cell Value" in Existing .xls file to Trigger built-in Macro

Posted by Nick Burch <ap...@gagravarr.org>.
On Thu, 6 Dec 2012, C.Y. CHEN wrote:
>> Apache POI doesn't support running office macros, nor changing them
>
> Thanks for the quick reply.  Any plan of supporting it in the roadmap?

Unlikely, unless someone comes along and volunteers to do it!

> Actually, I think my question may have been misleading.  Is it possible to
> just update the cell value of a running .xls instance?

Nope, windows is very protective of open files... POI will happily let you 
write changes to cell values, but most likely you'll need to tell excel to 
open the file afterwards for your use case

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: How to Commit "Update of a Cell Value" in Existing .xls file to Trigger built-in Macro

Posted by "C.Y. CHEN" <ic...@gmail.com>.
On Thu, Dec 6, 2012 at 1:51 PM, Nick Burch <ap...@gagravarr.org> wrote:

> On Thu, 6 Dec 2012, C.Y. CHEN wrote:
>
>> I have a .xls file that consists of 1 macro.  The macro will be executed
>> upon the update of a cell value.
>> I would like to write a java program to iterate through a list of input
>> values to a particular cell that will trigger the built-in MACRO that in
>> turn will update the existing sheet.
>>
>
> Apache POI doesn't support running office macros, nor changing them
>
> Nick
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
> For additional commands, e-mail: user-help@poi.apache.org
>
>


Nick:

Thanks for the quick reply.  Any plan of supporting it in the roadmap?
Actually, I think my question may have been misleading.  Is it possible to
just update the cell value of a running .xls instance?

Thanks!

Re: How to Commit "Update of a Cell Value" in Existing .xls file to Trigger built-in Macro

Posted by Nick Burch <ap...@gagravarr.org>.
On Thu, 6 Dec 2012, C.Y. CHEN wrote:
> I have a .xls file that consists of 1 macro.  The macro will be executed
> upon the update of a cell value.
> I would like to write a java program to iterate through a list of input
> values to a particular cell that will trigger the built-in MACRO that in
> turn will update the existing sheet.

Apache POI doesn't support running office macros, nor changing them

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org