Running an existing macro

Hallo there, 

Thanks for helping with the images (last post). 

Here is another question. I want to run an existing macro from a  template I opened in flexcel. How to do this?

Regards, Mark Ekkers


Sorry, but running a macro isn't supported, and there are no real plans to support this either. There are 2 reasons for this:

1)It goes away of the scope of features we want for FlexCel. Running a macro would mean to create our own Visual Basic compiler, which would be maybe as much code as we already have.

2)We see the fact that we can't run macros as a good thing. FlexCel is used a lot in servers creating documents, and the last thing you want to have from a security point of view is to let users run arbitrary code in your server. VBA is a very powerful programming language on its own, and you can do a lot of damage with a macro. This would also mean a lot of work in the security stuff for us, but there can always be bugs that compromise the server. So we think that the fact that we can't run macros at all is the best way to be sure there isn't a way to exploit some bug in or VB compiler.

To run macros you will have to start Excel with ole automation, and run them in Excel.

Hallo ,

In the demo, the advanced API example,the text reads "The starting template has a macro. At this time we can not create macros with FlexCel, but we can use existing macros".

That's why I thought I could use existing macro's.

Regards, Mark Ekkers


Sorry it was confusing. With "use existing macros" we mean that if you have a file that has a macro, open it, modify it and save it, the macro will still be there when for use when you open it in Excel. This is what the Advanced API demo does, it "creates" a file with a macro, even when FlexCel can't create macros. It wasn't about running the macros (Which as said is sadly outside our scope), but I can see it could be confusing. I'll see to make it more clear.