View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chrisso Chrisso is offline
external usenet poster
 
Posts: 110
Default Opening Word Docs from Excel VBA With full path and name 255 chars

Hi All

I have written some Excel VBA code to open Word documents. I gather
the full path and name in a string.

Dim sFullPathAndName As String
sFullPathAndName = fldrTarget.Path &
Application.PathSeparator & fTarget.Name
Word.Application.Documents.Open sFullPathAndName,
ReadOnly:=True

Sometimes when I then pass this string to
Word.Application.Documents.Open and it is greater than 255 chars I get
the error:

Run-time error '9105'
String is longer than 255 characters.

How can I open these documents with full path and name 255
characters.

Thanks in advance for any ideas.
Chrisso