Visio Guy

Visio Discussions => Programming & Code => Topic started by: Gustavo on July 07, 2020, 08:27:16 PM

Title: Action section "hidden" cells?
Post by: Gustavo on July 07, 2020, 08:27:16 PM
While I was creating an Action section and Rows with VBA, I used the macro recorder and when I add a new row in the Action section, it generates code that seems to add along with the common cells we know a Prompt cell and an Help cell, like this:
Application.ActiveWindow.Shape.CellsSRC(visSectionAction, RowNum, visActionPrompt).FormulaForceU = """"""
Application.ActiveWindow.Shape.CellsSRC(visSectionAction, RowNum, visActionHelp).FormulaForceU = """"""


These cells doesn't show in the Action section. Does anybody know where they come from, if are they functional and if so which functionality they have? I couldn't find any reference to this.

Regards
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 07, 2020, 09:45:58 PM
which version of Visio do you use ?

You can read about cells from Action section (https://docs.microsoft.com/en-us/office/client-developer/visio/actions-row-actions-section):
I find Section Action Prompt cell description (https://docs.microsoft.com/en-us/office/client-developer/visio/prompt-cell-actions-section), but can't find Section Action Help cell description
Title: Re: Action section "hidden" cells?
Post by: vojo on July 09, 2020, 12:14:55 AM
no such thing as actions.hidden or actions.help  cell

Are you talking about actions.invisible cell?   that would hide/show the action row on the drop downs.

google "visio shapesheet actions cells"   That will show the info on each cell in the actions row

Title: Re: Action section "hidden" cells?
Post by: Paul Herber on July 09, 2020, 02:14:51 AM
Can you get hold of a value for these two cell references? Display then in a debug window. Which version of Visio?
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 09, 2020, 09:20:30 AM
All sections have unused cells! For example if you run this macro for some shape, which have Action section.
Sub test()
Dim i As Integer, sh As Visio.Shape
Set sh = ActiveWindow.Selection(1)
For i = 0 To sh.Section(visSectionAction).Row(0).Count
    Debug.Print i, , sh.CellsSRC(visSectionAction, 0, i).Name
Next
End Sub
you get output like this
Quote0                          Actions.Row_1
1                          Actions.Row_1._Unused1
2                          Actions.Row_1._Unused2
3                          Actions.Row_1.Action
4                          Actions.Row_1.Checked
5                          Actions.Row_1.Disabled
6                          Actions.Row_1.ReadOnly
7                          Actions.Row_1.Invisible
8                          Actions.Row_1.BeginGroup
9                          Actions.Row_1.FlyoutChild
10                         Actions.Row_1I11
11                         Actions.Row_1J11
12                         Actions.Row_1K11
13                         Actions.Row_1L11
14                         Actions.Row_1.TagName
15                         Actions.Row_1.ButtonFace
16                         Actions.Row_1.SortKey
17                         Actions.Row_1P11

PS
This screenshot describe which constants used for these cells !
Title: Re: Action section "hidden" cells?
Post by: Paul Herber on July 09, 2020, 10:28:52 AM
Odd, looks like these cells show in VBA but they're not listed in the SDK, nor are they available via C#.
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 09, 2020, 12:30:09 PM
Paul, which SDK do you mean ? In online resource i find this
Quote from: Article Prompt Cell (Actions Section) (https://docs.microsoft.com/en-us/office/client-developer/visio/prompt-cell-actions-section) at docs.microsoft.comPrompt Cell (Actions Section)
Beginning with Visio 2002, this cell is no longer used.
This cell last time used in version Visio 2000. In pre-Microsoft era :)
Title: Re: Action section "hidden" cells?
Post by: Paul Herber on July 09, 2020, 12:37:32 PM
Ah, it's an old cell reference. I hadn't thought of that possibility.
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 09, 2020, 12:58:46 PM
Quote from: Paul Herber on July 09, 2020, 12:37:32 PMAh, it's an old cell reference.
Paul, you are right ! This article from SDK for Visio 2013 (https://docs.microsoft.com/en-us/office/client-developer/visio/visio-shapesheet-reference).
Latest SDK (https://www.microsoft.com/en-us/download/confirmation.aspx?id=51221) was for Visio 2016.
Quote from: Paul Herber on July 09, 2020, 02:14:51 AMCan you get hold of a value for these two cell references?
Visio 2016 Standard, i can get value from these cells, also i can change values and formulas in these cells with VBA-macro.
Title: Re: Action section "hidden" cells?
Post by: wapperdude on July 09, 2020, 01:25:11 PM
Ah!  Other than the mystery of it all, is there anything useful...or just merely placeholder/relics of the Cretaceous period???
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 09, 2020, 01:36:46 PM
Quote from: wapperdude on July 09, 2020, 01:25:11 PMOther than the mystery of it all, is there anything useful
Sometimes i use this trick, just write formula with SETF via macro in cell which dont displayed in ShapeSheet.
For example prevent change cell's value to 0.
Set sh = ActiveWindow.Selection(1)
sh.CellsSRC(visSectionAction, 0, visActionPrompt).FormulaForceU = "SETF(GetRef(LockDelete),GUARD(1))+DEPENDSON(NOW())"

Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 09, 2020, 02:57:30 PM
If check protected cell in Trace window you can find cell
Title: Re: Action section "hidden" cells?
Post by: vojo on July 10, 2020, 11:44:01 AM
like CERN, we have identified a new cell in the action row.
So what does it do?
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 10, 2020, 12:18:50 PM
IMHO, this cell is exist but don't used in current time.

Sections in ShapeSheet have structure like table. Columns ActionPrompt and ActionHelp was added in Action section
as first time. Another columns added in same time or later. In Visio 2002, these columns obsolete.
MS for keep compability, saved these columns and their positions. But make it invisible for users view :)
These cells available only via VBA.
Title: Re: Action section "hidden" cells?
Post by: Paul Herber on July 10, 2020, 02:05:45 PM
It does make sense. The cell definitions have to stay available to VBA otherwise any macros that use them will break for the user. Any addin/addon written in C++/C# wil still run for the user, but any attempt to compile the code will fail.
Title: Re: Action section "hidden" cells?
Post by: wapperdude on July 10, 2020, 02:08:51 PM
With regards to Actions Prompt cell, VBA won't barf over it, but, it does nothing. 

@Surrogate:  tried your code in V2019 and saw now visible results.  Certainly no visible behavior.  Only the bones remain.

@Vojo:  Sorry.  The discovery, itself, is what's "new".  What was discovered was quite old.  Archeology at its best.

Prompt Cell (Actions Section)

Beginning with Visio 2002, this cell is no longer used.

Remarks
In earlier versions of Visio, this cell specified a descriptive prompt that appeared in the status bar when you selected the corresponding shortcut command.

Title: Re: Action section "hidden" cells?
Post by: Paul Herber on July 10, 2020, 02:10:56 PM
A cell like this could be used for hiding data within the shape. The cell could still be written to using a numerical index, but the data would not be visible in the shapoesheet.
Who needs cryptography or steganography when you can hide data within a Visio shape!
Now, where is Pat Pending?
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 10, 2020, 02:18:16 PM
6 years ago we have thread about hidden ShapeSheet's cells in Russian Visio Forum (read it (https://www.translatetheweb.com/?ref=TVert&from=&to=en&a=https%3A%2F%2Fvisio.getbb.ru%2Fviewtopic.php%3Ff%3D5%26t%3D708%26p%3D6240) via Bing Translate service).
You can find a lot hidden/unused cells in ShapeSheet  ;)
Title: Re: Action section "hidden" cells?
Post by: Gustavo on July 13, 2020, 07:20:59 PM
To hide data is a good use! a password or hash would be hidden even for a user with decent programming knowledge. But is it possible to retrieve data from these cells?
Title: Re: Action section "hidden" cells?
Post by: vojo on July 14, 2020, 01:25:22 AM
so exactly how would hidden cells work if they are ultimately in xml when drawing saved?

And if you did have hidden cells....great way to ship a virus around
- virus sits in a hidden cell(s)....10 bytes to phone home or say 1MB of actual virus
- launcher virus looking for the shape on your system (downloaded from some public site because it looked cool) and launches the virus.
Title: Re: Action section "hidden" cells?
Post by: Surrogate on July 14, 2020, 07:01:09 AM
Quote from: vojo on July 14, 2020, 01:25:22 AM
so exactly how would hidden cells work if they are ultimately in xml when drawing saved?
If document where used these hidden cells save as vdx file format, secret formulas stop work !
Title: Re: Action section "hidden" cells?
Post by: vojo on July 15, 2020, 03:57:23 AM
maybe I am wrong, but I thought around 2013, drawing (even VBA) were saved in an xml format.

Title: Re: Action section "hidden" cells?
Post by: Gustavo on July 15, 2020, 06:25:16 PM
It would be nice to have these "hidden" or discontinued cells/columns listed for future references, in order to avoid confutions or headscratches. The VSDX File Format specs  https://interoperability.blob.core.windows.net/files/MS-VSDX/%5bMS-VSDX%5d-180724.pdf   (https://interoperability.blob.core.windows.net/files/MS-VSDX/%5bMS-VSDX%5d-180724.pdf)has some information about "hidden" cells with actual use, but there's barely information for discontinued cells that remain in the shapesheet anywhere.
Title: Re: Action section "hidden" cells?
Post by: wapperdude on July 15, 2020, 08:14:58 PM
Since these are hidden, thus, unknown, the risk of using one seems extremely small.  Except for this thread, I'd say most users are unaware of their existence.  Indeed, it takes code to discover them.  It's probably bad form to keep them.  It may keep old code from crashing, but it does possibly allow for incorrect execution of said code.  I think getting error msg is preferable.