Author Topic: How update embedded tables with code ?  (Read 324 times)

0 Members and 1 Guest are viewing this topic.

Surrogate

  • Hero Member
  • *****
  • Posts: 1572
    • ShapeSheet™ Knowledge Base
How update embedded tables with code ?
« on: April 12, 2022, 09:49:46 AM »
Hi, folks !

I have a Visio document in which three tables from Excel are embedded with linking.
When I edited the table with both opened application at the same time, everything was fine. In the Visio document, the changes were displayed almost in real time
After editing Excel with Visio closed, the data in the embedded table stopped updating. while I found a way to do this using the Links window.


I dont know how update embedded tables with code ?

Visisthebest

  • Hero Member
  • *****
  • Posts: 637
Re: How update embedded tables with code ?
« Reply #1 on: April 14, 2022, 04:28:56 AM »
Very interesting question, hopefully someone knows!
Visio 2021 Professional

Surrogate

  • Hero Member
  • *****
  • Posts: 1572
    • ShapeSheet™ Knowledge Base
Re: How update embedded tables with code ?
« Reply #2 on: April 14, 2022, 05:58:58 AM »
I find lame solution for this:
1. Search Links tool via Tell me… search pane
2. Add Links tool to Quick Access Toolbar

At my side this item get hotkeys Alt+0D
3. This code run update links with emulate press keys
Code
Sub vvv()
' call Links window with hotkeys Alt+0D
SendKeys "%0D"
'select all links in window
SendKeys "{UP}+{END}"
' Press key Update like as press Enter
SendKeys "~"
' Set focus at button "Close"
SendKeys "{TAB}"
'Press button "Close" like as press Enter
SendKeys "~"
End Sub

Visisthebest

  • Hero Member
  • *****
  • Posts: 637
Re: How update embedded tables with code ?
« Reply #3 on: April 14, 2022, 11:02:27 AM »
Never tried using something like SendKeys from a VB.NET VSTO add-in does that work properly as well?
Visio 2021 Professional

Surrogate

  • Hero Member
  • *****
  • Posts: 1572
    • ShapeSheet™ Knowledge Base
Re: How update embedded tables with code ?
« Reply #4 on: April 14, 2022, 05:02:01 PM »
Never tried using something like SendKeys from a VB.NET VSTO add-in does that work properly as well?
I tried using a VB.NET, but without success…
May be this article can helps: Keyboard.SendKeys Method

Visisthebest

  • Hero Member
  • *****
  • Posts: 637
Re: How update embedded tables with code ?
« Reply #5 on: April 15, 2022, 11:34:06 AM »
Thank you Surrogate!
Visio 2021 Professional