0

I'm exporting data in excel sheet via drupal view. Drupal views_export_xls module uses

http://code.google.com/p/php-excel/source/browse/branches/class-excel-xml.inc.php?r=9

library to export data into excel sheet. Every thing working fine. But i want little more from it.

How to add MACRO in excel sheet row or cell programmatically?

Is it possible to do so by php code?

If you look at above link - line no 88 & 93 which actually create cells and rows.

What i want to create a macro and place it on excel sheet that can later convert this generated excel file into native xml (.in) file for business purpose.

I've searched a lot but most of the link suggesting VB solution and i've no sense about this language.

Can anyone point me on right direction.

Any help would be greatly appreciated!

R3uK
  • 14,417
  • 7
  • 43
  • 77
Vikas Naranje
  • 2,350
  • 5
  • 30
  • 40

1 Answers1

1

As far as I'm aware, unless the Excel writer that you're using is based around COM, then there is no way of creating a Macro in an Excel workbook.

Mark Baker
  • 209,507
  • 32
  • 346
  • 385
  • Do you know other way to do this? I mean a library that can be used to create a excel sheet as well as gives ability to add macro on it. I'm completely flexible to adopt new approach to achieve both functionality. – Vikas Naranje Feb 07 '12 at 07:56
  • 1
    There's plenty of libraries that can be used to create Excel workbooks... see this list: http://stackoverflow.com/questions/3930975/alternative-for-php-excel The problem is macros. No library that I'm aware of supports macros. It's only if you're running MS Excel itself (via COM) that you could add a macro to a workbook. – Mark Baker Feb 07 '12 at 08:51
  • At what point, and why does this macro need to be executed by your users? There may be alternatives for converting the Excel to "native" xml, if the file is being uploaded to a server where you could script the conversion. – Mark Baker Feb 07 '12 at 08:52
  • Thank for the suggestion. I delayed to reply because i wanted to seek more. But i figured out that it's not possible in my case. Your suggestion also helped me to understand what can be done and what can not be. – Vikas Naranje Feb 24 '12 at 14:20