Hi,
I have been working on a workbook that contains Macro for hiding columns with Modano active.
I understand that Modano has password protection to prevent unwanted changes in the formula and formats but this has caused my code to break every time I re-open the workbook.
Is there any way to get around this without releasing the workbook?
Attached is a screenshot of the error that I got every time I run the code right after I open the workbook.
Thanks
Hi Alexander,
You need to use the Modano VBA API to safely manipulate content within sheets containing module components, including hiding and unhiding rows and columns. You cannot simply use normal VBA as this will cause the Modano meta data to diverge from the Excel file objects (e.g. Modano won't know you've hidden columns if you hide then using VBA without the Modano API) and ultimately corrupt your modular workbooks.
We've actually just updated the Modano API today to include the ability to hide and unhide columns within sheets containing module components within modular workbooks. To utilize this functionality, you will need to:
In your case, the example macro named 'Hide_Selected_Columns' in the module 'mExamplesColumns' demonstrates how to hide columns within sheets containing module components in modular workbooks using the 'SheetColumnSettingsUpdated' function within the ModanoApplication class. Here's the example macro code:
In your code, all the really need to do is add this to the start of your code:
And then whenever you want to hide columns call the SheetColumnSettingsUpdated function from within this class instead of using the normal VBA Range.EntireColumn.Hidden = False, as follows:
I'm aware this all seems very complicated but it's actually very easy to import the Modano API classes and do all sorts of things to module content. I'd recommend playing with the example macros throughout the modules in the API and getting your head around it, after which it should all become much clearer.
If you're still struggling I'd recommend buying a support credit via the Support section of your Modano account (www.modano.com/account/support) and one of the Modano team can walk you through it.
Godspeed. M,