C
calvinX
I have been working on this for a while now and would love it if someone
could help me. I am developing a COM add-in for visio using vs.net. I am
going to post my code here:
Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
Dim theObjs As Microsoft.Office.Interop.VisiLEObjects
Dim ExcelApp As Microsoft.Office.Interop.Excel.Application
theObjs = doc.Application.ActivePage.OLEObjects
If theObjs.Count > 0 Then
ExcelApp = GetObject(, theObjs(1).ClassID)
End If
Try
xlSheet = ExcelApp.ActiveWorkbook.Worksheets(1)
MsgBox("Got sheet reference")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Exit Sub
Thanks
Calvin X
could help me. I am developing a COM add-in for visio using vs.net. I am
going to post my code here:
Dim xlSheet As Microsoft.Office.Interop.Excel.Worksheet
Dim theObjs As Microsoft.Office.Interop.VisiLEObjects
Dim ExcelApp As Microsoft.Office.Interop.Excel.Application
theObjs = doc.Application.ActivePage.OLEObjects
If theObjs.Count > 0 Then
ExcelApp = GetObject(, theObjs(1).ClassID)
End If
Try
xlSheet = ExcelApp.ActiveWorkbook.Worksheets(1)
MsgBox("Got sheet reference")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Exit Sub
Thanks
Calvin X