简体   繁体   中英

Visual Studio 2013 Excel VSTO Add WPF Or Windows Form To Document

I want to know how to add a WPF Form or a Regular Windows Form to an excel Spreadsheet to collect data.

For example, I want a button, when clicked to open a WPF/WF which has a couple of checkboxes, and then I want to pass those values back to the worksheet. How would I do that?

As far as I know, there is no way to actually embed forms in a worksheet unless you were to wrap it up as an OLE object (yuck). You can however, show a dialog form to collect user input and have your VSTO AddIn populate or gather data from the excel sheet. I have used this approach with ease for cryptography scenarios where sharing sensitive data requires a runtime password.

In case you are not limited to an Excel AddIn, you could also push/pull data from an external instance of Excel. Let me know if any of these scenarios suit you and if you would like help with code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM