Run-Time Error 5151

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
AndrewMcLaughlinAsked:
Who is Participating?
 
rockiroadsCommented:
by valid I not only meant a valid path but also the document exists
0
 
rockiroadsCommented:
is the document path valid?

i.e. check what it is beforehand

msgbox m_strDIR & m_strTEMPLATE

0
 
nico5038Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.