Default_User
03-11-2008, 01:46 PM
Hi,
I'm working on a project that involves a database of computers in an Excel file being linked to a Visio drawing. The database contains various information about the computers, and links them to shapes on the diagram using their MAC addresses.
So right now, everything is linked fine, and when I click "Shape Data" on a computer's shape, I get all the needed information about it.
If something is changed in the Excel file, I click refresh in Visio, and all the changes are applied. But I want to make it so that if the Shape Data is changed in Visio, I can apply the changes back to the Excel file.
I've been messing around with VBA code, but so far have gotten nowhere. I'm sure I can figure out most of it, but right now I'm stuck on two essential parts.
1.) How do I access a shape's "Shape Data" field? I know how to retrieve things like the width and height of a selected shape, but there doesn't seem to be a way of reading the Shape Data.
2.) How do I reference an external Excel file in the code? I've read a bunch of code sample about how to work with Excel files, but I can't find anything about how to work with a file that is not currently open. Is this possible?
Thanks.
I'm working on a project that involves a database of computers in an Excel file being linked to a Visio drawing. The database contains various information about the computers, and links them to shapes on the diagram using their MAC addresses.
So right now, everything is linked fine, and when I click "Shape Data" on a computer's shape, I get all the needed information about it.
If something is changed in the Excel file, I click refresh in Visio, and all the changes are applied. But I want to make it so that if the Shape Data is changed in Visio, I can apply the changes back to the Excel file.
I've been messing around with VBA code, but so far have gotten nowhere. I'm sure I can figure out most of it, but right now I'm stuck on two essential parts.
1.) How do I access a shape's "Shape Data" field? I know how to retrieve things like the width and height of a selected shape, but there doesn't seem to be a way of reading the Shape Data.
2.) How do I reference an external Excel file in the code? I've read a bunch of code sample about how to work with Excel files, but I can't find anything about how to work with a file that is not currently open. Is this possible?
Thanks.