473,383 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

User defined type not defined error. Please help

Hi

I have an error message in access 97 database and I was hoping that someone can help me with this (i've been searching the answer but seems like I couldn't find the right answer). When I clicked the open word document button on one of the form, I got "User defined type not defined" error message. Here is the code that connected to the button

Expand|Select|Wrap|Line Numbers
  1. Private Sub openWordButton_Click() <------ highlighted in yellow
  2.             Dim objWord As Word.Application <------ highlighted in yellow
  3.          Set objWord = CreateObject("Word.Application")
  4.          With objWord
  5.             ' Make the application visible.
  6.             .Visible = True
  7.             ' Open the document.
  8.             .Documents.Open ("i:\sales.doc")
I went to the references properties on the menu bar and this is the list which are selected:
visual basic for applications, microsoft access 8.0 object library, microsoft DAO 3.6 object library. could someone help me please? Thank you so much in advance.
May 25 '07 #1
8 11787
puppydogbuddy
1,923 Expert 1GB
Hi

I have an error message in access 97 database and I was hoping that someone can help me with this (i've been searching the answer but seems like I couldn't find the right answer). When I clicked the open word document button on one of the form, I got "User defined type not defined" error message. Here is the code that connected to the button

Private Sub openWordButton_Click() <------ highlighted in yellow
Dim objWord As Word.Application <------ highlighted in yellow
Set objWord = CreateObject("Word.Application")
With objWord
' Make the application visible.
.Visible = True
' Open the document.
.Documents.Open ("i:\sales.doc")

I went to the references properties on the menu bar and this is the list which are selected:
visual basic for applications, microsoft access 8.0 object library, microsoft DAO 3.6 object library. could someone help me please? Thank you so much in advance.
Do you have a reference to the MS Word 8.0 object library?
May 25 '07 #2
Do you have a reference to the MS Word 8.0 object library?
No I don't, but I do have MS Word 9.0 object library and when I checked it, the user defined error disappearred, now I get new error message saying missing DLL file.
May 25 '07 #3
puppydogbuddy
1,923 Expert 1GB
No I don't, but I do have MS Word 9.0 object library and when I checked it, the user defined error disappearred, now I get new error message saying missing DLL file.
That probably means you need to register Word internally with windows. This is usually a simple process if done as shown below:

Open two Windows Explorer windows - one window displaying the .dll and the other Regsvr32.exe. Now drag the .dll over the Regsvr32.exe and presto the .dll is registered
May 25 '07 #4
That probably means you need to register Word internally with windows. This is usually a simple process if done as shown below:

[color=black][font='Times New Roman']Open two Windows Explorer windows - one window displaying the .dll and the other Regsvr32.exe. Now drag the .dll over the Regsvr32.exe and presto the .dll is registered[/font][/color]
thank you so much for the reply, but could you please help me on how to display the .dll file? is it all the .dll files? would you mind tell me the step by step? Sorry for the inconvenience.
May 25 '07 #5
puppydogbuddy
1,923 Expert 1GB
thank you so much for the reply, but could you please help me on how to display the .dll file? is it all the .dll files? would you mind tell me the step by step? Sorry for the inconvenience.

Sure. no problem.
  1. These are the two files you need:
    MSWORD9.OLB Located in the MS Office Directory
    REGSVR32.DLL generally located in Windows/System32 Directory
  2. Because they are in two different directories, in order to work with them at the same time, you have to bring them up in two different windows.
  3. Once you brought each file up in its own window, then all you have to do is mouse click on the word file (MSWord9.OLB) and drag it over the .dll file. As soon as you release the mouse again, you should get a message that the word file has been registered.
May 25 '07 #6
puppydogbuddy
1,923 Expert 1GB
oops! wrong file extensions: Regsvr32.exe and should be an MSWORD9.DLL
May 25 '07 #7
oops! wrong file extensions: Regsvr32.exe and should be an MSWORD9.DLL

Thank you so much.. I'll start working on it.
May 25 '07 #8
puppydogbuddy
1,923 Expert 1GB
Thank you so much.. I'll start working on it.
sorry wrong file extensions again:

it should be drag MSWord9.OLB over the Regsvr32.exe
May 25 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: YZK | last post by:
Hello. I'm not a Web developer, just a user, and I think I may have somehow messed myself up majorly. I'm not quite sure how. Right now, javascript used by websites I go to either does not work at...
6
by: Earl Anderson | last post by:
In A97 on WinXP, I'm trying to use a KB function to provide the next sequential number in a custom counter (a table with two fields-- and ). When I run it, I get the "User-defined type not...
5
by: Chris | last post by:
Hi everyone, I have an error message in an Access 97 database & I was hoping someone may be able to help me get rid of it (bearing in mind I only have an average understanding of Access &...
11
by: MLH | last post by:
I copied the following code snippet from A97 HELP. Am getting an error at compile time suggesting there's a problem with the first line (compile error, user-defined type not defined). It is likely...
5
by: Simon Harris | last post by:
Hi All, I am trying to call a method in a web form, from an event fired in a user control. My user control displays a map, which has a link button to enlarge/shrink the map. When the user...
9
by: abprules | last post by:
Can somehow tell me the best way for multi user development to occur in MS Access? The situation is: We are creating a new database for a small company. There are 2 of us who want to...
5
eragon
by: eragon | last post by:
I wrote this function to create a new file when the user posts in my forums, and its not creating a new file, can you help me? this script is not copyrighted as the last one. function...
1
by: kang jia | last post by:
hi when user entered particulars in signuppage and click" signup" button, i will direct them to do_signup.php. if say the NRIC is dupicate in datebase, i will redirect them back to signup page...
3
by: blakerrr | last post by:
Hi everyone, I am trying to export a table to an excel file using vba on a form's button click event. I am getting the error: Compile error: User-defined type not defined. And it highlights...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.