Link to home
Start Free TrialLog in
Avatar of AndrewMcLaughlin
AndrewMcLaughlin

asked on

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
Avatar of rockiroads
rockiroads
Flag of United States of America image

is the document path valid?

i.e. check what it is beforehand

msgbox m_strDIR & m_strTEMPLATE

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)
ASKER CERTIFIED SOLUTION
Avatar of rockiroads
rockiroads
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial