Excel controls in VSTO

I am looking for a control that performs the same actions as a custom function control in Excel

So, for example, when you click "Medium", a control appears that allows you to enter 2 numbers in text fields. On the right side of the text fields there is a button that, when clicked, allows you to select a range of values ​​in excel and, when selected, fills the text field.

Does anyone know VSTO or any other control that does this, so I don't need to code it myself?

+3
source share
2 answers

It exists , but it is not quite the same as the one you find in Excel. Grab the application object and call the InputBox method . These methods can display several modal input dialogs of various types. Type 8 is a range selection type, a type 8 dialog has a large text field, an OK button, and a cancel button (but there is no icon for a normal range selection). When the user clicks “OK”, the selected range is checked and the input field method returns the result. As in the "real range dialog", the user can select only the selected ranges while this modal dialog is open.

FROM#

Application.InputBox("Select a Range","title",Type.Missing,Type.Missing,
                              Type.Missing,Type.Missing,Type.Missing, 8);

Then use the return range to display in the TextBox.

+11
source

. , .net. , .

excel, VSTO Excel.

+1

Source: https://habr.com/ru/post/1708786/


All Articles