How to run Word macro in Excel macro

I am trying to run a Word macro in Excel macro. Could 
someone show me an sample?
Thanks
Kevin
0
anonymous (74725)
11/5/2003 3:28:53 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
265 Views

Similar Articles

[PageSpeed] 15

Kevin,

Try something like the following


Dim WD As Word.Application
Dim Doc As Word.Document
Set WD = New Word.Application
With WD
    Set Doc = .Documents.Open("C:\doc1.doc")
    .Run "Doc1!TheMacro"
    Doc.Close savechanges:=False
    .Quit
End With



-- 
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com    chip@cpearson.com


"Kevin" <anonymous@discussions.microsoft.com> wrote in message
news:0dfe01c3a3b1$8515c080$a601280a@phx.gbl...
> I am trying to run a Word macro in Excel macro. Could
> someone show me an sample?
> Thanks
> Kevin


0
chip1 (1821)
11/5/2003 7:21:21 PM
Reply:

Similar Artilces:

Need only one DLL instance to run...
Hi all, 1: if two apps load the same DLL - LoadLibrary(...) - system will create to different instance of the DLL... Now, in my DLL i've a CList and i need it to be visible to all instance and all apps!!!! Is there a way!? 2: I need the dll to remain loaded till machine reboot!!! Is it possible!? Thanks Ale >if two apps load the same DLL - LoadLibrary(...) - system will create to >different instance of the DLL... >Now, in my DLL i've a CList and i need it to be visible to all instance and >all apps!!!! > >Is there a way!? It'll be difficult to share a ...

Excel combo box
Is there an easy way to maintain a date format from the original cell through selection via a combo box? --- Message posted from http://www.ExcelForum.com/ If you add the items yourself--instead of using listfillrange, then the combobox from the control toolbox toolbar will keep the formatting: Option Explicit Private Sub Worksheet_Activate() Dim myCell As Range With Me.ComboBox1 .ListFillRange = "" .Clear For Each myCell In Me.Range("a1:a14").Cells .AddItem myCell.Text Next myCell End With End Sub or if you want...

My system shuts down when working in Word
Some documents in Word cause the system to shut. Drive lights are still on; but, not able to access. Have tried searching for viruses, but, none found. Anybody having this problem? Hello Legales1, I'm not sure this is an Outlook question (you might want to post in the Word newsgroups) but it would be helpful if you told us at least what version of Word you're using and what's unusual about those documents. -Ben- Ben M. Schorr - MVP http://www.rolandschorr.com Microsoft OneNote FAQ: http://www.factplace.com/onenote.html > Some documents in Word cause the system to shut...

Word Mail Merge with Excel as data file
Word 2003 Excel 2003 Windows XP Why would a mail merge show only every other Excel row when merging with a Microsoft Word form? I am also cross-referening this to the Word forum. Thanks in advance! Sounds like perhaps you have TWO <<next record>> fields in your main document for each, and you should only have one. ******************* ~Anne Troy www.OfficeArticles.com "HT" <asfafd@microsoft.com> wrote in message news:OER87r9hFHA.3260@TK2MSFTNGP10.phx.gbl... > Word 2003 > Excel 2003 > Windows XP > > Why would a mail merge show only every othe...

credentials to run this report are not stored
Hi all, I'm getting this problem when I try and create a timed subscription. Error: ...credentials to run this report are not stored..... ok I created another folder under the same folder where I'm having this problem. loaded the report and I have no problem. I even moved the current folder with that report in it. Creted another folder with the same name and still the same problem with that named folder. With a different name for the folder I have no problem??? I'm stuck here.. almost all post just talk about storing the credentials, Already done and works...

Automatically run macro
My name is Mike and i have a question about microsoft excel macro's. Attached is a copy of the excel sheet im working on. Below the excel sheet is the macro I built. Some of the cells contain given values and some cells are calculated from formulas. Cell (G4) is my given value...it is related to cell (C32). The point is, I plug a value into cell (C10) and it runs through the rest of the calcs in the other cells and gives me a value to cell (C32). I built a macro that works as a goal seek pretty much. The macro makes cell (C32) equal to cell (G4) and gives me the value for cell (C10). I wan...

System Error when opening Excel 2007
A client is receiving this error "system Error &H80004005(-2147467259)" in excel 2007 when opening a new file or an exisiting file. This error came up after visio 2003 was uninstalled and visio 2007 got installed on his system. This error can be a lot, and I looked a bit around where they say it might be something with memory. But then I wonder why he never gave this error before untill visio 2007 got installed. Any help is welcome and I would be very thankfull to those who can help me in this issue. Greetz ...

outlook 2000, email editor is word, no room for text
New user of Outlook 2000. Set WORD 2000 as email editor. Open for New mail and get big gray space after first line of tool bar and small space to enter text. Each subsequent new mail, the text space disappears completely as the gray space between the two tool bars expands. Please Help. Thanks, Meryl ...

run time error 10-22-03
I am having a lot of trouble when I open up word I get run time error 52 in VB. I have tried uninstalling word and reinstalling it. WE have tried deleting the macro but still to no avail can someone help me please? ...

Excel Validation Drop Down Box
Is there any way to increase the size of the text in the validation drop down box? If the sheet is zoomed to say 60% the text in the box is not readable. No, but you may find this helpful: http://www.contextures.com/xlDataVal08.html#Larger In article <0a4c01c3999c$92878a10$a001280a@phx.gbl>, "Mike S." <anonymous@discussions.microsoft.com> wrote: > Is there any way to increase the size of the text in the > validation drop down box? If the sheet is zoomed to say > 60% the text in the box is not readable. ...

Repost: Error running Report in an Access 2003 db from Access 2007
Ok, clarification - ignore the code from my original post, some of the reports do work. The ones that don't are reports that I have being filtered. Here is the code from one of those buttons: Private Sub Ok_Click() On Error GoTo Ok_Click_Err 'using the customer sub form for customer state report to filter the report, clicking ok will open report for selected state Dim stDocName As String Dim stLinkCriteria As String If Not IsNull(Me.Search_Results) Then stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"...

how to create shortcuts to word documents in sharepoint
I need a copy of the same document in several places, before using sharepoint i put shortcuts to a document in a folder in explorer so if one copy was updated they all were - can you do this in sharepoint - if so can anyone tell me how to do it? or something that works in the same way! Sure. SharePoint is just a web site so all the URL's are there and you can use standard browser/Windows functionality. Go to the doc library. Right mouse click to the document of intest. Pick "copy shortcut". This puts the URL into the Windows clipboard. Go to the folder on on yo...

Excel Short of memory error
Where is the repair feature to try and fix this problem? Perhaps you could give us a few more details:- What OS What version Excel When does the error occur Is it specific to one file Does it happen to all files Does it happen with no files but when you start excel All of these things help us enormously, and the trick to getting a good answer is in asking a good question, else you end up dancing around with a dozen different options whilst we run through the book.. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro /...

Populatibng excel sheet from access
First post from someone more used to using Access, so please be kind. I have developed a database containing exam results which should the be exported to a spreadsheet designed by someone else. the problem is the fields in the spreadsheet are Surname | First name | DoB | Entry 1 (0-11) | Entry 2 (12-22) etc. My problem is merging the data and ensuring the result goes into th correct cell. We have had a nightmare over the past couple of week trying to do this without the office link, and I am just wondering i it is possible to generate the required spreadsheets? Thanks in advance. mjc6 --...

tables created by Linking an Excel File
Hi Mates I have a linked access table created from an excel spreadsheet. Then I used Table Analyze feature in access to split this and the split created 3 seperate tables. When the excel spreadsheet is changed the linked table gets updated but split tables remains unchanged. Is there a way these split tables to get updated automatically. Thanks mates in advance for your help. Sarah W Hi Sarah, The table analyzer is designed for splitting a non-normalised table into two or more new, normalised tables. This is a one-time process: the new tables are entirely separate from the old one. T...

Excel Continuous Running Total
I posted a message earlier and have received a partial solution. I want to keep track of how much stock prices go up or down with a running total of how much they go up or down over several days until the direction changes. For example, if price go up 10 on Mon, 20 on Tues, 30 on Thurs and down 10 on Fri I want my running total column to show a positive number of 60 and then a red number of 10 and continue adding the amount of the total of the down days until the market shows an up day. The formula I am now using total the first and second day but does not do a running total count if t...

display changing label caption on form as sub runs w/o screen flic
let's say i have this routine Sub Test label1.caption = "Starting ... " 'do events label1.caption = "Getting there ... " 'do events label1.caption = "Finished! ... " End Sub on my form, i have label1 right in the middle what happens is sometimes the message will change, and then sometimes it wont, or it will show the first one, skip the second and jump to the third etc etc etc so it is inconsistent. is there a way to make sure the label caption displays consistently, on time, wh...

Create a custom footer for all Excel worksheets at one time...
I want to create a custom footer, just once, that could be applied to all worksheets in an Excel workbook. Microsoft Word lets you do this, so why not Microsoft Excel? BigCat Try the code below: Be sure to substitute the information for what you want. HTH Dennis ******************************************** Sub PageSetupAllSheets() Dim EachSheet As Worksheet For Each EachSheet In ActiveWorkbook.Worksheets With EachSheet.PageSetup ' &F = File ' &A = Tab ' &D = Date ' &T = Time ' &P = Page ' &N = Pag...

Conditional Formatting in Excel
Hi, If D1 is empty then G1 should be white(clear) if D1 has a number in it then G1 should be red additionally; if a value, either a figure 0 or a currency value is entered in G1, which owing to the previous two conditions, would be red, then G1 should change to blue. If anyone can explain how to acheive this I would be extremely grateful. Thank You Brian Ok, you have a few conditions: Isblank(d1) means clear Formatted as Currency Means “Blue” Any value not formatted as Currency Means Red Step 1 I would insert a column to calculate this and format based on the resu...

Where's a similar (useful) MS Word forum / newsgroup?
This newsgroup contains a vibrant and active discussion on MS Outlook, with frequent replies from Outlook MVPs, expert users, etc. Although I've found the microsoft.public.word newsgroup, it seems to be pretty "dead," without much in the way of meaningful contributions. Is there another newsgroup that addresses MS Word issues, which has more activity? Or some other good reference source? I've tried MS's pages (support.microsoft.com) and lots of Google searches ... but cannot find help for the specific question I have (which I posted in microsoft.public.word, but won&...

Money 2002 will not run
I had been using Money 2002 for approx. 3 yrs on my home pc (Dell Dim 2100, XP Home Ed. w/SP2). Last year, it simply would not launch. No error message, no splash screen, no app opening, no process listed in Task Manager. Just.... nothing.... The only change that was made to the system since M2k2 last ran was upgrading my a/v solution from Trend Micro PC-Cillin to TM Internet Security. I have tried disabling every aspect of the Internet Security product, as well as completely un-installing the app, and then attempting to run Money, but the same thing (nothing) happens. I was considerin...

macro which finds last cell in a column
please help me by telling a macro which finds last cell in a column thank -- Message posted from http://www.ExcelForum.com Dim LastRow as Long LastRow = Range("A65536").End(xlUp).Row or if you just want to select it: Range("A65536").End(xlUp).Select Regards Trevor "vikram >" <<vikram.15hp0w@excelforum-nospam.com> wrote in message news:vikram.15hp0w@excelforum-nospam.com... > please help me by telling a macro which finds last cell in a column > > thanks > > > --- > Message posted from http://www.ExcelForum.com/ > ...

No macros in 2008
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) I thought i was doing the right thing trying to convert to the whole office to Mac's! We run all our invoicing, accounts and stock on excel workbooks. they are now very complex and interlinked. I have automated the whole thing using macro and VBA and i feel right royally stuffed! <br><br><i>understand there is no easy or quick solution from what i have read on the forum. i do find it hard to believe such a useful function is just taken away.</i>&#32;<br><br>Can i run spreadsheets ...

Re: Workflow just wont run automatically, i have to run them manually
Yes, but i realized what i was doing wrong. I assumed [bad idea] that if i create a case and hit Save & Close the first time, taht the rule will run. In order for the rule to run automatically, it has to be Save, once it saves it, then Save & Close. Thanks for your reply. "Hi, Did you check the workflow monitor to see if the rules get triggered correctly and complete sucessfully ? Have a nice day, St=E9phane Dorrekens " --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://...

Excel Invoice #2
How do you transfer data, such as name, address, date, hours, charge per hour, and total charge, from an Excel spreadsheet to an Excel invoice without copying and pasting? Hi, Ann. Try something like this: http://www.officearticles.com/tutorials/order_form_or_invoice_form_in_microsoft_excel.htm Pay particular attention to the link in the 2nd bullet. ************ Anne Troy www.OfficeArticles.com "Ann" <Ann@discussions.microsoft.com> wrote in message news:1951D37F-6385-41CC-A33A-A0A28AAA4875@microsoft.com... > How do you transfer data, such as name, address, date, hours...