How to provide multiple choice in generated Excel file
I'm working on an application that generates a series of Excel files where users need to enter information for school grades. One of the sections requires the user to enter a value from a selection of three possibilities.
I thought it would make sense to do this with ActiveX radio buttons. However, I noticed that the size of the files increased heavily when using these controls and that the files become somewhat unresponsive when opening. Note that I have a few hundred to a thousand radio buttons, depending on the amount of information is required.
Is there any advice or ideas o开发者_运维问答n alternative approaches to this? Would it help to use the older form controls (non-ActiveX) in order to keep file size low and increase responsiveness? Or will I not have enough options to work with the older controls, given that at a later stage I also need to read the Excel files and the input of the users?
FWIW, I'm using the following code to create new radio buttons:
worksheet.OLEObjects().Add(ClassType: "Forms.OptionButton.1");
You can use Data Validation for the cells. You simply create a named ra(nge somewhere and use Data Validation -> List and the user will get a combo box in the cell with the choices in the list specified. If you want to store the list (options) in another sheet, you need to create a named range.
精彩评论