Visio Guy

Visio Discussions => Programming & Code => Topic started by: Lars-Erik on April 25, 2008, 06:06:17 AM

Title: Reference Excel.Application in Visio VBA
Post by: Lars-Erik on April 25, 2008, 06:06:17 AM
I'm trying a microsoft example (http://msdn2.microsoft.com/en-us/library/aa140253(office.10).aspx (http://msdn2.microsoft.com/en-us/library/aa140253(office.10).aspx)), when i try to generate the excel BoM i get an error.

Roughly translated:
"A user defined data type is not defined"

VBA tells me the problem is somewhere with
Dim appExcel As Excel.Application

Anyone know why its not doing this?

Commenting shows me it also crashes on:

Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

- Lars-Erik

Title: Re: Reference Excel.Application in Visio VBA
Post by: aledlund on April 25, 2008, 04:12:06 PM
did you include the excel libraries in your references
Title: Re: Reference Excel.Application in Visio VBA
Post by: Visio Guy on April 25, 2008, 05:08:49 PM
Tools > References when you're in the VBA editor...
Title: Re: Reference Excel.Application in Visio VBA
Post by: Lars-Erik on April 25, 2008, 07:20:21 PM
That did it, thanks...