Juan ,your the greatest...but...!!!

J

Just4fun

Hi Juan,


you gave me the solution to my question (lots of thanks for that),
I wanted to open a file on given input:




MyFile = "C:\Documents and Settings\TG\Mijn Documenten\" &
ActiveCell.Value & "_document.xls"

Application.Workbooks.Open MyFile



And it works....Many, very many thanks.

But... I need your help once more.
I would like to open a WORD document (.doc) not a .xls
I know the .xls has to be changed into .doc
But the "Application.workbooks.Open MyFile"line has to be changed.
Into what ?



Thanks (again) in advance.

Theo
 
J

Juan Sanchez

I'm blushing and sad to say that I can not figure it out...

I know I have done something similar before, I just can't
find my macro...

Sorry Theo, I will keep trying, and post if I find
something...

Cheers
Juan
 
P

Paul B

Just4fun, see if this will help

Sub word_macro()
'You will need to set a reference to microsoft word object library
Dim MyWord As Word.Application
Set MyWord = CreateObject("Word.Application")
MyDoc = "C:\My Documents\test.doc"
MyWord.Documents.Open (MyDoc)
MyWord.Visible = True
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top