1

We have a large number of excel files. I want to modify the macros in each of the file. The change is same across all file. A specific use case would be to change initialization of string from ABC to abc.

Is there a programmatic way to access and edit a particular function. Java would be preferable but other language would be okay.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Aman Deep Gautam
  • 8,091
  • 21
  • 74
  • 130
  • Any COM "aware" language can modify an Excel file with the COM interface. Although there are [several tools](http://stackoverflow.com/questions/138028/is-it-possible-to-call-a-com-api-from-java) to achieve that, Java may not be the best suited language. You can however do it with C#, C++, VB.net, even PowerShell – z̫͋ May 07 '14 at 12:55
  • You can do this even with VBA http://www.cpearson.com/excel/vbe.aspx – David Zemens May 07 '14 at 13:57

1 Answers1

0

You can easily do it in VBA by programming the VBE (VB editor). This references 'Microsoft Visual Basic For Applications Extensibility 5.3.' which presumably you could do in Java too. Have a look at this guide: http://www.cpearson.com/excel/vbe.aspx

Community
  • 1
  • 1
steveo40
  • 931
  • 5
  • 11