News:

Happy New Year!

Main Menu

VisioExcelSync

Started by Yacine, November 05, 2024, 12:00:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yacine

Introduction to the Excel-Visio Sync Tool
Motivation
Often in our daily work, we're asked to add custom properties "on the fly" to shapes in Visio. Changing or adapting your main work tools every time a new requirement arises is cumbersome. What if there was a lightweight, flexible solution to meet these evolving demands without hardcoding specific changes every time?
Additionally, what about those colleagues or stakeholders who don't have Visio but still need to work with your data? Even worse, what if they need to modify that data, and you then have to re-import it into Visio? Usually, you'd have to write custom import/export routines for these tasks. But imagine having a completely generic tool that allows you to define which shapes and fields to import without any hardcoding.
Enter the Solution
That's exactly what this tool does: It lets you define filters for import operations and specify the fields to read from Visio shapes.
The tool is designed for flexibility. For example, you might be working with different types of datasets—sensors, actors, connectors—all with different fields and properties. Instead of hardcoding, you define everything in a global configuration that specifies which datasets to handle, and each dataset gets its own specific definition sheet.
Why Excel?
Instead of developing a GUI to display and edit the data in a tabular format, why not use Excel? Excel is almost universally available, and I can't think of a better tool for editing tables. Thus, Excel is the chosen platform for our solution.
 
Yacine

Yacine

#1
Features
·        Custom Data Syncing: You can read shape properties from Visio and also edit them directly from Excel. The tool then automatically updates Visio based on any changes you make in Excel.
·        Two-Way Syncing: If you select a row in Excel, the corresponding shape in Visio is automatically selected and zoomed in on—giving you a direct visual feedback of what you're editing.
·        Multi-Shape Selection: You can also select multiple rows in Excel, and the tool will automatically select and zoom on the corresponding shapes in Visio.
·        Table Formatting: The data in Excel is formatted as tables, making it easy to sort and filter, so you can focus only on relevant information.
·        Control Form for Flexibility: Not everyone likes automatic updates or zooms. The tool includes a control form where you can toggle features like auto-selection, auto-update, and zooming.
·        'All Data to Visio' Button: Suppose someone else worked on the Excel sheet, and you need to update your Visio shapes accordingly. No problem! There's a button called "All Data to Visio" to take care of that for you.
·        Select in Visio, Update in Excel: The tool even lets you go the other way: select a shape in Visio, and the corresponding row in Excel will automatically be highlighted.
·        Real-Time Updates: Any time you update a field in Visio, the tool will check if that field is part of your defined dataset and, if so, update Excel in real-time.
Custom Property Management
One of the original motivations for this project was the ability to handle arbitrary custom properties. A function in the control form lets you easily add a new custom property to all selected shapes in Visio. After that, simply add this field to the definition sheet, and you can start editing it in Excel.
For shapes that don't have that field yet, you'll see "NA" as the value—making it easy to spot where the field is missing.
A Lightweight, Generic Solution
Many have written tools to sync Visio shape data with Excel, but this one shines because it is extremely lightweight (only one Excel template with macros), has a minimalistic source code, and is completely versatile. It allows you to define filters and fields, focusing solely on enabling tabular editing of properties in Excel.
Another cool feature: you can choose whether to work with ResultStr or Formulas, depending on what you need at the moment. This flexibility allows for different types of use cases—whether you are adjusting values or working with more complex Visio formulas.
Extending Filters and Fields
Currently, the filters are limited to two functions: CellExists and CellValueIs
. You could extend these to include others like "contains", "greater than", "less than", etc.
to allow for more complex filtering.
The fields are defined just as you would in VBA—not simply as "ABC", but more specifically as "prop.ABC" or "user.ABC". This provides extra flexibility to target various types of properties like "PinX", "FillForeGnd", etc.


Yacine

Yacine

#2
Custom Editing and Magic in Excel
Besides regular tabular editing, you can also disable automatic updates, add some formulas, and then press the "Update All to Visio" button to push your changes. This can be used for a lot of creative work like rearranging shapes, applying colors, and more.

Special Fields
In addition to normal cell values, the tool can also handle properties that are not strictly cell-based, such as shape ID, name, master, and text.

Acknowledgements
Dear audience, thank you for your attention. I also want to express my gratitude to my mother, my father, my beloved wife and children ;D , and, last but not least, OpenAI's ChatGPT-4o, which made this project possible.
Yacine

Yacine

Jokes aside, the excel template attached on the first post, is freely readable by anyone.
It is valuable for me because it solves problems,I've been carrying for years.

If anyone out there does too and feels the need to add functionality, please do so. If any help is needed don't hesitate to ask.

Cheers,
Yacine
Yacine

Nikolay

#4
Sounds really cool. I've tried something similar a while ago with the BackSync.
Was able to sell it exactly TWICE ;D ;D ;D

Looks like the problem was, the ones who cared to check it out,
were always building their own luna park with blackjack and hookers (i.e. with VBA)

wapperdude

Not @my computer, presently, so will try your Excel file later.  As I was reading the initial post, I thought, this is flawlessly written, no autocorrect, well organized, well expressed, clinically clean...must be AI.

Good touch breaking this into smaller, readible sections.  Avoids being overwhelming.

I like the post a lot.  But, I'm not going to "Like It" because of the AI.  I know it started with your input, but I'm still leery of AI.  Nonetheless, kudos!!!
Visio 2019 Pro

Yacine

#6
@Wapperdude,

Hey, thanks for catching that I used AI here! I'm not shy about it—honestly, it's been a super handy tool for getting things done faster.

Normally, I have to wait until the Christmas holidays to get enough time to work on bigger coding projects. But with AI, I managed to get this one done over just the All Saints holiday. It's a huge time-saver, and I think that's pretty awesome.

It's not like AI does all the heavy lifting for me. I still have to put my experience with Visio to good use and guide it where I need it to go. It's more of a teamwork thing between me and the AI.

What's really cool is that sometimes AI feels like a coach, and other times like a therapist. When I get stuck, it helps by quickly throwing out new ideas. Sure, some of them are nonsense, but just having that back-and-forth keeps me thinking until I come up with the right solution myself.

Not using AI now would be like refusing to use Excel and insisting on doing every calculation by hand. Just like Excel boosts efficiency, AI makes my work faster and easier, and that's what counts.

And it's not just about the coding part; it helped me write this post too. I'm an engineer, not a writer, so I'm more interested in getting my point across clearly than showing off my English skills.

I'm also not here to prove I'm the best coder out there. The goal is all about making Visio more useful and getting things done effectively.

AI is definitely changing how we work, and I'm happy I'm still curious enough to dive into it.

Yacine

Yacine

#7
@ Nikolay,

I was initially a bit hesitant to publish my tool here, especially knowing about your own tool. I realize that this creates a certain level of competition, which I would have preferred to avoid.

Your tool is certainly more professional and robust. However, mine is tailored to meet my very specific needs (my own Luna Park with BlackJack 'n hookers), which include:

- Instantaneous Selection and Synchronization: Selecting a shape in Visio or a row in Excel automatically reflects in the other application. When working with my P&IDs, I need that immediate visual feedback. I can't just focus on one application without seeing the changes in the other.
- Portability Without Installation: I wanted a lightweight tool that works without any installation, one that can be easily shared with stakeholders or colleagues without much setup. An Excel workbook with embedded macros is ideal for that purpose.
- Flexibility in Customization: The ability to add properties on the fly, filter as needed, and choose what to display provides significant advantages for my workflow.

I understand that projects like this may impact your business, and I do feel a bit conflicted about that. I hope my perspective makes sense.

Best regards, 
Yacine

Yacine

Nikolay

#8
Dear Yacine, the backsync was literally bought only twice, and one time by mistake, I guess ;D
There is no "business" related to it, unfortunately, which proves the thing lacks some critical features to be useful.
Hopefully your app can address these real needs.

I was planning to make backsync completely free / open source anyway,
just need to find some time to make a README stuff so that it is not that embarrassing  ;D

It definitely looks like a better idea to have sync immediate, and not deferred with conflict resolution. Other than that,
https://www.youtube.com/watch?v=_5-gP3jKciI

Yacine

Which would bring us to the thought of what would Visio users would be willing to buy?
Extremely interesting:
- what is beyond common VBA?
- how big shall a solution be?
- how easy shall the monetizing solution be?

Visio is not only needed everywhere, but it is also not complete. How can we get people like you, Paul and Chris to earn some money?
Yacine

Thomas Winkel

#10
Visio is rarely used in the field, and when it is, it is usually only for simple scribbles.
Few people are aware of the power under the hood.
For comparison, look at how many Excel forums there are and how many posts are posted there every day.
I'm afraid there simply isn't a significant marked for Visio solutions.
There may be some companies that require regular consultation and specific solutions...

I couldn't test your tool because I couldn't get it to work.
Can you create a short video on how to use it?

But I added a Ribbon menu for better usability:
You cannot view this attachment.

Yacine

#11
Hi Thomas,

You're incredible. This ribbon is certainly a game changer for my tool. I never expected anyone here to invest so much effort into one of the projects I uploaded.

That's truly wonderful.

I've already spent half a day updating my work with the solution you provided, but I haven't been able to complete it in a reasonable time. I wanted to express my gratitude before uploading my final changes.

As for the YouTube explanation, you're absolutely right—it's something worth showing, even though it's challenging.

I've also thought about putting the project on GitHub to make it more accessible and to give others the opportunity to enhance it.

Your work shows exactly why it's legitimate for someone like me—who isn't a great programmer—to use AI. The idea is to get the best possible result, not to show off my skills. Any good programmer can always come in and show how it can be improved, like you did here. And that's why it makes perfect sense for me to ask for help. It's about improving the project, and thanks to your input, that ribbon is a real win.

Thanks again for everything.

Best regards,
Yacine

Thomas Winkel

Hi Yacine,

don't worry, the effort was not too much because I can copy from my solutions.
If you need help to get startet with these Ribbon things we can also discuss this in a teams meeting.
You could also think about an Excel Addin (xlam) to deploy your solution.
It's a bit like storing code in a Visio document vs stencil.

I also like using AI for my projects. Mainly for generating demo code, but also for consulting.
This helps me do things I have no idea about ;D
Really powerful!

👋

wapperdude

I'm with Thomas...despite its value,  I suspect there's a really small audience these days.  One has no further to go than the forum to see the dwindling number of inquisitees.  (My new word.). The bulk of participation is amongst the core brotherhood.  And now, with chatty AI, questions will continue to drop.  What might be of universal interest is a Visio centered chatAI.
Visio 2019 Pro

Yacine

I couldn't agree more. With all our tinkering and tweaking, we're really just entertaining ourselves. 
Every so often, a 'noob' fly stumbles into our web—but only by accident. 
The future will definitely be in AI. One trained specifically on the data from this forum would be immensely powerful.
Yacine

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 593 (show)
Files included: 32 - 1207KB. (show)
Memory used: 1332KB.
Tokens: post-login.
Cache hits: 15: 0.00268s for 26,553 bytes (show)
Cache misses: 4: (show)
Queries used: 20.

[Show Queries]