simple code won't work on my friends machine

C

Charlie

My friend just installed word XP, and I am on a machine that I just installed
Office XP. I have this Word template with some macros in it and I emailed
him a copy and everything works for him but one macro.
the line is
Documents("Friends Reference List").Activate

We both have this other Word document open, and for me it works fine, it'll
take the focus to the document "Friends Reference List" and continue the
code. but on his machine it give an error saying that it's not a valid file
name! I don't understand it. It's definitely there because it was previous
code that created the document on both our computers. I don't know why it
doesn't see this word doc on his machine but it does on mine...
Please Help, thanks,
ck
 
J

Jezebel

That line doesn't open the document. It assumes that the document is already
open, and switches focus to it. It will throw an error if the document is
not open, which is (presumably) what is happening on your friend's machine.
Close the document and it will happen on yours, too.
 
C

Charlie

I found an answer for this, though I don't understand it...
(BTW, we both have the document open). On my machine it works, on his it
doesn't, UNLESS, I add .doc to the file name, then it works on his machine!
Is this because I have Office XP installed, and he only has Word XP?
charlie
 
D

Dawn Crosier

He has modified his Windows installation to show file extensions.
Inside of Windows Explorer, select the Tools menu, then select the
Folder Options menu. Select the View tab, and note that you have
"Hide extensions for known file types" selected, and his is cleared.

--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.
 

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