Word.doc's opened in excel

  • Thread starter Thread starter Chris.Cole
  • Start date Start date
C

Chris.Cole

I have a spreadsheet that contains index information.

I need to be able to click ( ? double click) on a cell that contains
word.doc description (eg WI000_24.doc) and have that document open i
word.

There are 265 doc's listed in a column.

There are some blank cells in the column.

The column contents will change (daily / weekly)

Your help is appreciated.

Chri
 
Try this

Add a button on your worksheet and assign this macro to it
It will open the file that is in the activecell (change the path in the macro to yours)

Sub test()
Dim WordApp As Object
If ActiveCell.Value = "" Then Exit Sub
If Dir("c:\Data\" & ActiveCell.Value) <> "" Then
Set WordApp = CreateObject("Word.Application")
WordApp.documents.Open "c:\Data\" & ActiveCell.Value
WordApp.Visible = True
End If
End Sub
 
Work fine on the local C:\

but not across the network

If Dir("S:\DIV\IN_ELC\Work Documents" & ActiveCell.Value) <> "" Then

Hopefully I will sort this out.

Thanks again

Chris
 
I'd assume that the problem with the network exists in either 1 of 2
areas.

A) The network drive letter changes on different computers (unlikely to
be the cause of your problem)

B) The spaces in your folder names are causing issues. I've had this
happen before. Try a folder that doesnt contain spaces (example from my
computer P:\Ci24\Faxes\Completed\20040204\)
or maybe try referencing the file in DOS 8 char filename?
(P:\ci24\faxes\comple~1\200402~1)

And that might actually fix it... You never know. You might get lucky.
:P

Hope it helps.

-Bob
 
If Work Documents is a folder you must add a \

If Dir("S:\DIV\IN_ELC\Work Documents\" & ActiveCell.Value) <> "" Then
 
Back
Top