Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
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
Error opening Word document from Excel VBA code engineer_rich Excel Programming 3 April 9th 08 09:26 PM
excel and power point error on log on, word opening slowly dcccgoose Excel Discussion (Misc queries) 1 September 12th 06 04:48 AM
Opening Word in Excel Jeralc Excel Programming 3 February 16th 06 01:33 PM
Opening Word from Excel David Excel Programming 4 June 6th 05 03:37 PM
Opening WORD from Excel Bob Reynolds[_3_] Excel Programming 1 August 4th 04 04:07 AM


All times are GMT +1. The time now is 09:53 AM.

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

About Us

"It's about Microsoft Excel"