1

We want to embed macro code in excel sheet using php.

We are using PHPExcel to generate a excel workbook, which is successfully generated.

Now we just want to embed macro code in this excelsheet.

R3uK
  • 14,417
  • 7
  • 43
  • 77
Naveen
  • 21
  • 1
  • 3
  • 2
    'Fraid you're out of luck unless you write the code to handle embedding macros yourself..... it's not a feature that PHPExcel supports, and I'm not aware of any PHP library for writing Excel spreadsheets that does – Mark Baker Nov 30 '15 at 08:08
  • What did you tried so far? Put the infos in your question. – jogo Nov 30 '15 at 08:24
  • What is "the code" that you want to run? You could have an addin containing the code if its for functions, a little code could add. – Nathan_Sav Nov 30 '15 at 10:40
  • #mark Baker, actually we imported data from database and even we did all validation, but now we want to disable cut/copy/paste/save option from excel using macro. We got the code also, but dont know how to embed with php. My php creating a excelsheet with data and validation – Naveen Nov 30 '15 at 15:14
  • This is a very bad idea and I would recommend that you start with prewritten Excel workbook templates containing the VBA. – Nigel Heffernan Nov 30 '15 at 18:17
  • So, you want to say that we should create one excel file with VBA embed in it, then use this file in PHPExcel for adding the values in cell, later on save the file with different name ? – Naveen Dec 01 '15 at 01:37

0 Answers0