Author Topic: Reference Excel.Application in Visio VBA  (Read 8022 times)

0 Members and 2 Guests are viewing this topic.

Lars-Erik

  • Sr. Member
  • ****
  • Posts: 278
Reference Excel.Application in Visio VBA
« on: April 25, 2008, 01:06:17 AM »
I'm trying a microsoft example (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

« Last Edit: April 25, 2008, 03:05:39 PM by Visio Guy »

aledlund

  • Hero Member
  • *****
  • Posts: 1412
Re: Reference Excel.Application in Visio VBA
« Reply #1 on: April 25, 2008, 11:12:06 AM »
did you include the excel libraries in your references
« Last Edit: April 25, 2008, 03:07:15 PM by Visio Guy »

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Reference Excel.Application in Visio VBA
« Reply #2 on: April 25, 2008, 12:08:49 PM »
Tools > References when you're in the VBA editor...
« Last Edit: April 25, 2008, 03:07:48 PM by Visio Guy »
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Lars-Erik

  • Sr. Member
  • ****
  • Posts: 278
Re: Reference Excel.Application in Visio VBA
« Reply #3 on: April 25, 2008, 02:20:21 PM »
That did it, thanks...
« Last Edit: April 25, 2008, 03:07:25 PM by Visio Guy »