Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2014, 06:10 AM
OTPM OTPM is offline User-defined Type not Defined VBA Issue Windows 7 32bit User-defined Type not Defined VBA Issue Office 2010 32bit
Expert
User-defined Type not Defined VBA Issue
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default User-defined Type not Defined VBA Issue

Hi Folks
I have some sample code from the web to open an mpp file but I am getting the following error message on the first few lines of code as shown below:



Sub Sample()
Dim appProj As MSProject.Application
Dim aProg As MSProject.Project
Dim wb As Workbook
Dim ws As Worksheet

Error message: User-defined type not defined

I have ticked the Reference to Microsoft Office 14.0 Object Library and I am using Office/Project 2010.
I have also referenced the Microsoft DAO 3.6 Object Library.

Any advice would be appreciated to resolve this issue.

Kind regards

Tony

Post script: Just found the issue, I was missing two References for MS Project.
Reply With Quote
  #2  
Old 01-02-2014, 09:53 AM
JulieS JulieS is offline User-defined Type not Defined VBA Issue Windows 7 64bit User-defined Type not Defined VBA Issue Office 2010 32bit
Expert
 
Join Date: Dec 2011
Location: New England
Posts: 1,693
JulieS will become famous soon enough
Default

Wow, asked and answered!
Reply With Quote
  #3  
Old 01-02-2014, 12:14 PM
OTPM OTPM is offline User-defined Type not Defined VBA Issue Windows 7 32bit User-defined Type not Defined VBA Issue Office 2010 32bit
Expert
User-defined Type not Defined VBA Issue
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi Julie
That will teach me to look properly before posting :0).
Tony
Reply With Quote
  #4  
Old 01-02-2014, 01:47 PM
JulieS JulieS is offline User-defined Type not Defined VBA Issue Windows 7 64bit User-defined Type not Defined VBA Issue Office 2010 32bit
Expert
 
Join Date: Dec 2011
Location: New England
Posts: 1,693
JulieS will become famous soon enough
Default

Better you found it than someone else
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
User-defined Type not Defined VBA Issue FileSystemObject Compile Error: User-Defined Type Not Defined gsrikanth Excel Programming 2 03-28-2022 06:32 AM
User-defined Type not Defined VBA Issue Excel 2003 User Defined Function Allan_H Excel 1 03-08-2013 09:36 AM
User-defined Type not Defined VBA Issue Range.Information(wdStartOfRangeRowNumber): Application-defined or Object-defined err tinfanide Excel Programming 2 06-09-2012 10:19 AM
User-defined Type not Defined VBA Issue Application-defined or Object-defined error Manit Excel Programming 4 12-08-2011 07:35 PM
User-defined Type not Defined VBA Issue User Defined Default Settings in Insert J_oe Word 1 02-17-2011 10:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:59 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft