Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Is it possible to format a shape in Microsoft Visio so that the shape has mouseover interactivity and can display a pop-up image or text box?  What steps in Visio would you execute to generate shapes like this in a process flowchart?
12
General Visio / Re: Reference page by ID instead of name
« Last post by wapperdude on October 23, 2021, 09:05:27 AM »
Proposed approach ought to work.  The question becomes a matter of minutes effort.  For a document with only a handful of pages, this wouldn't be too bad.  If the number of pages is quite high and/or vary over time, then automation (coding) is probably a better solution.  A bit more time upfront, but more accommodating to page count changes.
13
General Visio / Re: Reference page by ID instead of name
« Last post by dmac101 on October 22, 2021, 05:58:31 PM »
Hi All, I have managed to achieve this using =SETF(GetRef(TheDoc!User.Project_Name),Prop._VisDM_Project_Name).
Still working on it but now moving forwards.
14
General Visio / Re: Reference page by ID instead of name
« Last post by dmac101 on October 22, 2021, 05:25:27 PM »
Alternatively can I reference shape data directly from a separate page. ie something similar to the below ?

=Pages[CoverPage]!sheet.1659!Prop._VisDM_Project_ID
15
General Visio / Re: Reference page by ID instead of name
« Last post by dmac101 on October 22, 2021, 05:04:56 PM »
Thanks all, The TOC was only one aspect of what i was trying to achieve and i am really struggling due to my programming knowledge. I have started to look at this from a completely different angle now.
Goals:-
  • add name of each page to specific text field (one for each page) to cover page
  • add drawing ID for each page in text field adjacent to page name on cover page
  • link project name and project id from cover page to specific field on each page
  • link cover page to external data
I was exploring the idea of using the document User-defined cells to store the data for project name and ID, then link each page to it. This seems to work but I am not sure if there was a way to link the document user cell to a shape data field so that when i link to external it updates the doc user field which in turn then updates all pages. If this is feasible I would then look at creating document user field for p1name, p2name, etc and push from each page.
So far i have only been able to access the document user fields through drawing explorer shapesheet. Can i reference specific pages and shapes from the document shapesheet or can i push to document user cells from any shapes shapesheet?
 
 
16
General Visio / Re: Reference page by ID instead of name
« Last post by Surrogate on October 22, 2021, 04:02:19 PM »
@Surrogate:  shapesheet solution!?!   :o. I can believe it's hard to explain.  That required a lot of creative/resourceful thinking!!!
Of course there is a lot of limitations:
1. User can rename page not more that one time;
2. The first figure to be dropped on the page is the text from which is to be displayed in the TOC.
Epic video just for lulz please watch it with English sub-titles

UPD few days ago i find this 3rd party macro for create TOC
17
Thank you Wapperdude that is also a possibility using the clipboard, copy from Excel, paste into a Visio shape's text then retrieve the text from the shape.

Thank you Surrogate I will give that code a try, need to change it a bit for VB.NET in particular the code using Variants to copy the Excel Cell contents into a Visio array, as we don't get to use these o-so-convenient-to-use Variants anymore in VB.NET.

(actually I use Option Strict as much as possible, which requires more effort programming but does make debugging simpler:).
18
With this code you can itterate all cells in selected range
Code
Sub xls_query()
Dim oExcel As Object 'Excel.Application
Set oExcel = CreateObject("Excel.Application")
Dim sp As Object 'Excel.Workbook
Dim sht As Object 'Excel.Sheets
Dim tr As Object
Dim tc As Object
Dim qx As Integer
Dim qy As Integer
pth = Visio.ActiveDocument.Path
Dim ffs As FileDialogFilters
Dim sFileName As String
oExcel.Visible = True
Dim fd As FileDialog
Set fd = oExcel.FileDialog(msoFileDialogOpen)
With fd
.AllowMultiSelect = False
.InitialFileName = pth
 Set ffs = .Filters
    With ffs
        .Clear
        .Add "Excel", "*.xls*"
    End With
oExcel.FileDialog(msoFileDialogOpen).Show
End With
sFileName = oExcel.FileDialog(msoFileDialogOpen).SelectedItems(1)
Set sp = oExcel.workbooks.Open(sFileName)
sp.Activate
Dim UserRange As Object ' Excel.Range
Dim Total As Object 'Excel.Range
oExcel.GoTo Reference:=sp.Worksheets(1).Range("A2")
oExcel.ActiveCell.Select
Set UserRange = oExcel.InputBox _
(Prompt:="Please select range", _
Title:="Select range", _
Type:=8)
Set Total = UserRange
For Each tr In Total.Rows
    rc = rc + 1
    sc = 0
    For Each tc In Total.Rows.Columns
        sc = sc + 1
    Next tc
Next tr
ReDim arr(rc, sc) As Variant
For qx = 1 To rc
For qy = 1 To sc
Debug.Print Total.Cells(qx, qy) '
Next qy
Next qx
sp.Close SaveChanges:=False
oExcel.Application.Quit
End Sub
19
Not at my computer... cannot test direct approach, but what ought to work...

 In my original code, the Excel contents are placed into Visio shape as text (string).  Once pasted, use resultstr to retrieve and assign to a variable.  Delete the shape. 
20
Let users select a value from various statistical tables for various statistical distributions: https://home.ubalt.edu/ntsbarsh/business-stat/StatistialTables.pdf

They only have to do this very rarely, so doing it this way is fine and they can use their own custom statistical table Excel file if they want this way.
Pages: 1 [2] 3 4 ... 10