troubleshooting Question

Open Excel from Visio

Avatar of Jimbo99999
Jimbo99999Flag for United States of America asked on
Microsoft ExcelMicrosoft Visio
4 Comments2 Solutions420 ViewsLast Modified:
Hey There

I used the code attached below to Open Excel from behind a button in Excel as a prroof of concept kind of thing.  Now, armed with the code snippet, I am trying to get this to work
in Visio.  However, I am not having any luck.  I get the error message "User-defined type not defined" on the first line.  Is there a refrence or library I need to add to call Excel from behind a button in Visio?

Thanks,
jimbo99999


Dim exapp As Excel.Application
    Dim exbook As Excel.Workbook
    Dim exsheet As Excel.Worksheet
    Set xlapp = CreateObject("Excel.Application")
    Set xlBook = xlapp.Workbooks.Open("C:\QualityDashboard\quality_dashboard.xls")
    Set exsheet = xlBook.Worksheets("Training")
    exsheet.Select
    xlapp.Visible = True
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros