Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Mar 23, 2017 2:30 am

Hey,

Is it possible using Spire to click on a macro like a user would?

I have a few macros inside of the excel that that do the follwoing
- show/hide' fields/areas
- prompt user with pop up box and choose form a drop down list

Can this be duplicated in Spire.xls? My company has the latest version of Spire.Office

Dylan_Spire
 
Posts: 18
Joined: Wed Jun 15, 2016 1:28 am

Thu Mar 23, 2017 6:57 am

Dear Dylan_Spire,

Thanks for your inquiry.
Sorry that Spire.XLS does not support to manipulate macro. But there is solution may meet your needs.
Code: Select all
            // hide/show the area by setting the number format
            worksheet.Range["A1"].NumberFormat = ";;;";           
            worksheet.Range["B1:C11"].DataValidation.InputMessage = "Please input";
            Validation dataValidation = worksheet.Range["B1"].DataValidation;
            CellRange cr = dataValidation.DataRange;
            String s = cr.Cells[1].Value;
            //choose the value from drop down list
            worksheet.Range["B1"].Value = s;

Hope this helps, if there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Mar 23, 2017 11:04 am

Thanks for that, I'll see what I can come up with your solution.

Thanks again

Dylan_Spire
 
Posts: 18
Joined: Wed Jun 15, 2016 1:28 am

Tue Mar 28, 2017 7:38 am

Dear Dylan_Spire,

How is the issue going ?
Did the solution solve your issue ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.XLS