LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Opening doc in macro

I figured it out. I didn't realize that I only had MS Office referenced,
instead of Office and Word. The macro is running now.
I have one more question. I need to run this macro for several documents,
do I need to make a complete new macro for each document or is there a way
that I can add the docs to this macro have it work for each doc.?

"Michelle Hanan" wrote in message
...
I understand what you're saying Tony, however when I run the macro in excel
it highlights the myDoc as Word.Document line of code and gives me a
compile error: User-defined type not defined. I don't understand why or how
to fix it.
"tony h" wrote in
message ...

Trying to get the referencing right is not easy in these situations if
you don't have much experience.

A first step though : change ActiveDocument to myDoc. Basically at the
beginning you open the document and "call it" myDoc. Now no matter what
else happens if you use myDoc it is the document you opened. Whereas
ActiveDocument is just the document that is active at the time - which
maynot be the one you opened.

This point is true for anything that is labelled Active... or
current... etc

Do you know how to use the debug tools? look up these - especially F8.



hope this helps


--
tony h
------------------------------------------------------------------------
tony h's Profile:
http://www.excelforum.com/member.php...o&userid=21074
View this thread:
http://www.excelforum.com/showthread...hreadid=560754







 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro buttons opening saved macro Wasabijim Excel Discussion (Misc queries) 0 April 29th 09 08:39 PM
run macro on opening brian thompson3001 via OfficeKB.com Excel Discussion (Misc queries) 5 December 11th 06 09:13 PM
Macro upon opening Peanut Excel Worksheet Functions 1 October 2nd 06 11:25 PM
Run Macro Upon Opening Bill Mosserati[_2_] Excel Programming 1 June 18th 04 05:26 PM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM


All times are GMT +1. The time now is 10:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"