I've been messing around with importing/exporting VBA modules and classes in an Excel app that I work on. Seems really useful to use with version control. I like it. I can easily implement code changes in modules, export my changes, commit and push my changes, and "reload" (delete all modules and re-import) my changes in another instance of the Excel app.
However, I can't find a way to use this with sheets. If I add a visual change to a sheet (say, I add a button or change the way the sheet looks), is there a way to export the sheet as code, just like modules, so that I can then import the sheet exactly as it looked from my changes?
I'm aware of some pseudo-solutions to this already, but are either not going to fit into what I need in terms of version control, or will be too much of a lift. For one, I can write a VBA script to copy my Excel app to a .xlsx file, which will house any of my sheet changes, and then I can import them into another instance of the app if I wanted to. The problem with that is that I won't be able to include them in my version control. I also know that I can write scripts in the event Workbook_Open
to essentially make my user interface on my sheets programmatically each time the Excel app is opened. This will solve my problem of committing my code, but is too much of a lift.
Any suggestions or solutions to this problem?
EDIT: To be clear, I'm aware that I can export my sheets as modules as well. However, there doesn't seem anything that indicates what the sheet looked like on export. Consequently, when I import the "sheet", it is imported as a class module.