Macro to enable each time a spreadsheet is open

30 views
Skip to first unread message

Jason Olchovy

unread,
Aug 13, 2013, 12:09:56 PM8/13/13
to licss...@googlegroups.com
Hello again,

I was just playing around with what it would take to enable this every time I have a specific spreadsheet open.

This sometimes works, and sometimes gives me the problem where the SMILES window does not show up and on ctrl-T I get resized blank cells.  

In CustomSetup, I use your lSetup and remove the dialog box WkBkSelection and message boxes, and just designate the activeworkbook as toWkBook.

I have a sub that is triggered from a worksheet as follows, where this references your LICSS addin:

Sub EnableSmilesStructures(sht As Worksheet, rng As Range)
    Application.Run ("licssv3.0.xla!CustomSetup")
    sht.Select
    rng.Select
    Application.Run "SetSmilesName"
    Application.Run "DisplayRowStructure"
End Sub

As stated, problem I run into is that this works sometimes and sometimes not.  What would you recommend?

Thanks!
Jason

Kevin Lawson

unread,
Aug 14, 2013, 6:36:44 AM8/14/13
to licss...@googlegroups.com
Hi Jason

If LICSS is working properly, you shouldn't have to enable workbooks each time you open them. Once they are enabled and saved then re-opening them should automatically enable all the LICSS features [<Ctrl T> etc]. The way this works is that the LICSS add-in checks each time a workbook is opened to see if it is a LICSS-enabled workbook (you will see a workbook name: LICSS=TRUE if you press <Ctrl F3> for enabled workbooks). If it is, the add-in creates StructureDisplay objects for each worksheet within the workbook which contain a named range Smiles. Any scatter charts associated with these worksheets are also enabled at this time. Because the add-in does all the work, you can save LICSS-enabled workbooks in the xlsx (macro-free) format; they don't need to contain any code (incidentally: have you tried switching to the LICSSPrograms tab (from a sheet with a Smiles named range) which exists for all LICSS-enabled workbooks to explore the other things, Substructure search etc, LICSS can do?)

Once you are working with an enabled workbook, you can create new sheets and set them up merely by using <Ctrl Shift M> to name the Smiles range. Actually, <Ctrl Shift M> does more than just name the Smiles range - it also runs the routine: ActivateStructureDisplay if necessary. This is equivalent to what happens when the workbook is opened - all the appropriate StructureDisplay objects are set up ready to display structures. If you create a scatter plot with x data on a sheet with a Smiles name then you need to run ActivateStructureDisplay manually before the chart will display hover structures; either press <Ctrl Shift A> (directly runs ActivateStructureDisplay) or save, close and re-open the workbook.

I have attached a minimalist LICSS workbook with just two structures on a single sheet to demonstrate this. If you have LICSS installed, just opening the workbook and clicking on one of the two Smiles strings should show the structure; <Ctrl T> should also work.

Hope this helps - if I have misunderstood what you are trying to do please let me know.

Best wishes

Kevin
TestLICSS.xlsx

Jason Olchovy

unread,
Aug 20, 2013, 12:39:25 PM8/20/13
to licss...@googlegroups.com
Thanks Kevin that will work for what I need.
Reply all
Reply to author
Forward
0 new messages