Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 91 - Opening Word from Excel
I am stumped. I have a workbook that runs a macro to open a Word
template and copies data from Excel into the word template at bookmark locations. The workbook works great on most users PCs. There are two users that are receiving an Error 91 at the point the Word doc tries to open the template. Since it usually seems to work, I can't figure out what might be different. I have looked at Reference, Security settings, and disabling virus software on the user's pc, but it doesn't matter. I am beginning to think there is something more direct I need to define in the code. Maybe my statements are too ambigous to open the word template?? Any help would be appreciated. I am copying the code that creates the status report below. ----------------------------- Sub CreateReport1() 'COMPLETE STATUS REPORT On OnError GoTo EndFile ' Create a Word document using a template Set WordApp = CreateObject("Word.Application") 'starts word Set WordDoc = WordApp.Documents.Add("C:\PS Project Templates\PS Status Report1.dot") ' Hide Make the newly created Word instance WordApp.Visible = False '******** Project Name ******** WordApp.Selection.Goto What:=wdGoToBookmark, Name:="ProjectName" Worksheets("Budget").Range("A2").Copy WordApp.Selection.PasteSpecial DataType:=wdPasteText ''******** Budget Baseline ******** WordApp.Selection.Goto What:=wdGoToBookmark, Name:="BaselineValue" Worksheets("Summary").Range("G8").Copy WordApp.Selection.PasteSpecial DataType:=wdPasteText '******** Budget Spent******** WordApp.Selection.Goto What:=wdGoToBookmark, Name:="BudgetSpent" Worksheets("Summary").Range("G9").Copy WordApp.Selection.PasteSpecial DataType:=wdPasteText '******** Budget Remainig******** WordApp.Selection.Goto What:=wdGoToBookmark, Name:="RemainingBudget" Worksheets("Summary").Range("G10").Copy WordApp.Selection.PasteSpecial DataType:=wdPasteText 'go to the top of the word doc WordApp.Selection.Goto What:=wdGoToBookmark, Name:="top" '-------Make the Word doc visible------------ WordApp.Visible = True ' Clean up EndFile: Set WordDoc = Nothing Set WordApp = Nothing End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 91 - Opening Word from Excel
Hi Anne,
Check that the users all have the same build of Excel and Work. http://groups.google.com/group/micro...5 6648dd6827b It might yield something. Greg |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 91 - Opening Word from Excel
http://word.mvps.org/faqs/InterDev/C...WordFromXL.htm
You may be interested in this too: http://word.mvps.org/FAQs/InterDev/C...XLFromWord.htm Regards, Ryan--- -- RyGuy "Greg Glynn" wrote: Hi Anne, Check that the users all have the same build of Excel and Work. http://groups.google.com/group/micro...5 6648dd6827b It might yield something. Greg |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 91 - Opening Word from Excel
On Jul 10, 9:47*pm, Greg Glynn wrote:
Hi Anne, Check that the users all have the same build ofExceland Work. http://groups.google.com/group/micro...rogramming/bro... It might yield something. Greg Thanks Greg! It took me awhile to get info back from the user, but the build numbers are different: mine - Excel 2003 (11.8211.8202) SP3 user - Excel 2003 (11.8169.8172) SP3 Is there any way I can find out what might be diff between these builds to help me narrow in on the problem? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error 91 - Opening Word from Excel
On Jul 15, 7:07*pm, Anne wrote:
On Jul 10, 9:47*pm, Greg Glynn wrote: Hi Anne, Check that the users all have the same build ofExceland Work. http://groups.google.com/group/micro...rogramming/bro... It might yield something. Greg Thanks Greg! *It took me awhile to get info back from the user, but the build numbers are different: mine -Excel2003 (11.8211.8202) SP3 user - *Excel2003 (11.8169.8172) SP3 Is there any way I can find out what might be diff between these builds to help me narrow in on the problem? Thanks to everyone for the replies. I just wanted to loop back and post that I finally solved the problem. After having the user update their applications to the same build number I was using the problem still persisted. I ended up rewriting the code that opens Word from Excel to use Late Binding instead of Early Binding. It resolved the issue! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error opening Word document from Excel VBA code | Excel Programming | |||
excel and power point error on log on, word opening slowly | Excel Discussion (Misc queries) | |||
Opening Word in Excel | Excel Programming | |||
Opening Word from Excel | Excel Programming | |||
Opening WORD from Excel | Excel Programming |