We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Using XlsIO to Call Macro in Excel

Dear SupportTeam,

In my C# project, I use XlsIO to open an exsting Excel file with macro in it.

Will you please show me how to call an exsting macro in Excel file ?

Thanks


6 Replies

CH Chen September 2, 2013 03:02 AM UTC

I explore some articles in your Forum and find the answer.

Because XlsIO does not support Macro, i already found other solution for my problem.

Thanks.



SR Sridhar Syncfusion Team September 2, 2013 05:02 AM UTC

Hi Chen,

Thank you so much for the update.

We are glad to know that the above reported issue has been resolved at your side. Also, please get back to us if you have any queries.

Thanks,
Sridhar.S



MH Mangesh Hirave March 17, 2016 07:32 PM UTC

Hi Chen,
Can you please provide me the solution or a link to where you found the answer?
Thanks



DB Dilli Babu Nandha Gopal Syncfusion Team March 18, 2016 05:21 AM UTC

Hi Mangesh,
 
You can create an AddIn for the macro and invoke the AddIn function from XlsIO. A brief explanation about the usage of Excel Add-in in XlsIO is available in following UG link.

 

UG documentation link: http://help.syncfusion.com/file-formats/xlsio/working-with-formulas#add-in-functions

 

Regards,

Dillibabu.



DA Davide Azzaroni July 31, 2018 09:10 AM UTC

Hi,
 I need to clear filter in a table, but I know that there isnt a clear method to do it.
So I made a Macro that does it and save it in a Add in.
Then I loaded the Addin from code, but I do not know how to call the addin(macro)
can you help me?
thank you



PK Prakash Kumar D Syncfusion Team August 1, 2018 09:40 AM UTC

Hi Davide, 

Currently, XlsIO doesn't have support for Macro manipulation. We have added it to feature request list and it will be implemented in any of our upcoming releases.  

To clear the filters in the table, we suggest you disable the IListObject.ShowAutoFilter property. Please refer the code snippet below. 

Code snippet: 
//Create table 
IListObject table = worksheet.ListObjects.Create("Table", worksheet["A1:C7"]); 
                
//Add filter 
IAutoFilters filters = table.AutoFilters; 
IAutoFilter filter = filters[0]; 
filter.AddTextFilter("Ernst Handel"); 
                
//Clear filter 
table.ShowAutoFilter = false; 
 
Regards,
Prakash Kumar
 


Loader.
Live Chat Icon For mobile
Up arrow icon