Creating an ALL in one command button for shape reports

Started by Nbove, March 11, 2021, 04:11:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nbove

Hey Everyone,
So I currently have a single command button that when selected presents the user with a user form. There are 4 option on the form, A,B,C & ABC Shape reports. If the user has shapes A & B on the page, they have to perform the following twice...

Select command button, select A, select Enter, Report gets ran.
Repeat, but with selection B.

If the user has shapes A,B, and C on the document, then they can just press option ABC. and Poof all shapes are reported.

If user has shapes A & C, and selects option ABC, the shape report fails and causes an error.

Is there ANY way to have a consolidated option that will be smart and not report if a shape doesn't exist?
Like
If
Shape A exist do This
End If

Sorry new to coding hope i explained this well enough.
Thanks

Thomas Winkel

Hi,

are you talking about the integrated Visio Shape Report feature?
Or did you code your own report in VBA?

Could you provide an example Visio document?

Nbove

Integrated Visio Shape Report Feature, I have all the reports I want to run within the document. I have VBA coding there to just help facilitate running the report without having to have the user manually doing it.

Thomas Winkel

I have the same scenario: Different shapes, one report, triggered by VBA.
I guess the error is: "No shapes have the selected properties or satisfy the report selection."
Correct?

You could add a common User property to your (A, B, C) shapes.
For example: User.Report="BoM"
Then you can add this as condition to your report as attached picture.

If this does not help, please attach an example as vsd.

dirjohn3

Good afternoon!
It seems that you have the capability of triggering .vrd report with Vba.
Please would you be kind enough to indicate me how to trig easily the integrated Visio shape report with Vba or any means. Are there some way to execute one .vrd file wih vba? Are .vrd files recognized by visio vba? The standard menu last too long for frequent iteration...... thanks for you return.

Surrogate

Quote from: dirjohn3 on March 16, 2023, 02:05:13 PMAre there some way to execute one .vrd file wih vba?
May be this advice can helps
Quote from: Tumanov (a.k.a. Croc) in Russian Visio Forum message #17271Another option - try to enclose only the file name in double quotes when starting from a file. Something like thisApplication.Addons("VisRpt").Run ("/rptDefName=""C:\temp\INV INV.VRD"" /rptOutput=Excel_Shape")