Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visio / Excel OLE Automation

Status
Not open for further replies.

sirmanson

Programmer
Nov 6, 2001
12
0
0
US
I have a visio document that has an embedded excel worksheet. I am trying to manipulate the worksheet through code. Does anyone have any code snippets that may help me out?? I can find TONS of documentation on how to control excel from visio, just nothing on how to get excel to open an embedded object.
Thanks,
 
Ok, So I found the object in Visio

document.pages(1).layers(1).shapes(2)

if I pull the progID for this shape it shows "Excel.Sheet.8" which is correct. So now I just need some help figuring out how to have OLE open this up. I tried setting 2 Excel variables (and adding to the references)

Dim xlSheet As Excel.Sheets
Dim xlWB As Excel.Workbook

Then I try to initialize the excel sheet like this
Set xlSheet = shpObj.Object.Worksheets (1)

but none of the calls to xlSheet work. Does anyone have any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top