Author Topic: Pulling in data from Excel (without Data Import Utility)  (Read 738 times)

0 Members and 1 Guest are viewing this topic.


  • Jr. Member
  • **
  • Posts: 15
Pulling in data from Excel (without Data Import Utility)
« on: November 08, 2018, 12:47:39 PM »
Hello world!

I have very little experience with Visio VBA and have a high level question.

I have an Excel file (it's a questionnaire). It's formatted simply - Column A is the question, column B is the answer. Most are Yes/No although some a free-text. Additionally, some questions have multiple answers (for example the question in column A has answers in columns B, C, D and so on...)

What I want to know is how can import this data into Visio using VBA. I have Visio Standard 2016 so I do not have the data import utility that is included in Visio Professional. My goal is to use this data in macro functions (like IF/OR/Loop statements), as well as to populate labels & shape text on my diagram with these values.

The Goal
I am looking for a way to pull the data in from Excel, store it in an array or as variables, and then use that data to drive further macro functionality.

Is this possible? I would really appreciate the help :)


  • Hero Member
  • *****
  • Posts: 2682
Re: Pulling in data from Excel (without Data Import Utility)
« Reply #1 on: November 08, 2018, 02:22:24 PM »
I found a funny link answering your exact question.

No offence meant ;).


  • Jr. Member
  • **
  • Posts: 15
Re: Pulling in data from Excel (without Data Import Utility)
« Reply #2 on: November 08, 2018, 05:47:04 PM »
I appreciate the blunt answer  ;D
I promise I did my fair share of Googling beforehand though haha. I made this post hoping to learn more about the code that's used to do the import. I've read through a couple of posts with sample code (like the one from your search) and I don't follow along with the code - like I read it and don't know what's really happening. Is there perhaps a post out there that explains more? I have practically no experience with VBA (or any coding) and am jumping headfirst into this project!

I'd appreciate any light you may be able to shed on this  :)


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3753
  • Ideas Visio-lized into solutions
Re: Pulling in data from Excel (without Data Import Utility)
« Reply #3 on: November 08, 2018, 06:00:04 PM »
Since Yacine answered your question, I'll answer a different question or two...

Yes, with VBA, you go thru an Excel file and pull in data from designated rows and columns.  But, it takes some work.  (Note:  I'm talking from a V2007 Std perspective, but the overall process should be about the same for V2016 Std).

Yes, with VBA, the data you pull in can be stored in a Visio shape and/or, in an array (VBA structure). 

Yes, with VBA, you can copy portions of an Excel spreadsheet and store it on a Visio drawing page.

Finally, yes, with VBA, you can use these values in either a macro or in a specific Visio shapesheet cell, so that it's available for additional shapesheet processing.

I think Yacine was making two points:
1) your questions are very vague, so, they're difficult to answer.  There isn't any single instructional resource that covers Visio / VBA.  Not generally.  Not specifically.
2)  search.  You need to search.  Google can help.  You can somewhat narrow the field with Visio vba get excel spreadsheet values, or similar searches.
3) search the forum.  Here's a link that might help with your problem:

...your task is do-able, but, somewhat involved.


Visio 2019 Pro


  • Jr. Member
  • **
  • Posts: 25
Re: Pulling in data from Excel (without Data Import Utility)
« Reply #4 on: November 09, 2018, 03:22:39 AM »

i asked similar question in this topic:

I pin up to this topic,