?
Solved

Run-Time Error 5151

Posted on 2004-03-29
3
Medium Priority
?
4,770 Views
Last Modified: 2009-02-24
I receive a Run-Time error 5151 message when I try out a module in Immediate view.  When I choose the debugger it yellow highlights the line:

Set m_objects=m_objWord.Documents.Add(m_strDIR & m_strTEMPLATE)

Can anyone suggest what's going wrong here?

Thanks,

Andrew
0
Comment
Question by:AndrewMcLaughlin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 10703434
is the document path valid?

i.e. check what it is beforehand

msgbox m_strDIR & m_strTEMPLATE

0
 
LVL 54

Expert Comment

by:nico5038
ID: 10703446
Would help when you post the exact message.
Some thoughts:
1) Do you have a final "\" in the m_strDIR
2) Does the constructed name already exist ?

Nic;o)
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 2000 total points
ID: 10703450
by valid I not only meant a valid path but also the document exists
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question