Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime error 429
I have a macro that will not run consistantly, keeps getting runtime errror
429: activex component can't creat object. Are my set and dim codes wrong:?? Dim myDoc As Word.Document Set myDoc = Word.Documents.Open("\\powervault2\home_pl\common\ Referrals\Referal Agency - Ecology.doc") |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime error 429
It needs an instance of Word in which to open the document... Give this a
try... dim appWord as object dim myDoc as object set appWord = CreateObject("Word.Application") set myDoc = appWord.Documents.Open("\\powervault2\home_pl\comm on\Referrals\Referal Agency - Ecology.doc") -- HTH... Jim Thomlinson "Michelle Hanan" wrote: I have a macro that will not run consistantly, keeps getting runtime errror 429: activex component can't creat object. Are my set and dim codes wrong:?? Dim myDoc As Word.Document Set myDoc = Word.Documents.Open("\\powervault2\home_pl\common\ Referrals\Referal Agency - Ecology.doc") |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime error 429
That seems to work great. I now need to put in a code to close the document
at the end of the macro.I'm just not sure where this needs to be placed. Here is the ending of the macro. Thanks! FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With .Execute Pause:=False End With End Sub "Jim Thomlinson" wrote in message ... It needs an instance of Word in which to open the document... Give this a try... dim appWord as object dim myDoc as object set appWord = CreateObject("Word.Application") set myDoc = appWord.Documents.Open("\\powervault2\home_pl\comm on\Referrals\Referal Agency - Ecology.doc") -- HTH... Jim Thomlinson "Michelle Hanan" wrote: I have a macro that will not run consistantly, keeps getting runtime errror 429: activex component can't creat object. Are my set and dim codes wrong:?? Dim myDoc As Word.Document Set myDoc = Word.Documents.Open("\\powervault2\home_pl\common\ Referrals\Referal Agency - Ecology.doc") |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Runtime error 429
Maybe this will clear things up a bit. I am running 17 different macros that
call eachother at the end. I need something also at the end to close the macro so the next one will run. Right now without that code it opens the first document which is ecology and prints this one 17 times. And all 17 documents are opening with the macro but not printing or closing. This is what my macros look like: Sub Ecology() Dim appWord As Object Dim myDoc As Object Set appWord = CreateObject("Word.Application") Set myDoc = appWord.Documents.Open("\\powervault2\home_pl\comm on\Referrals\Referal Agency - Ecology.doc") ActiveDocument.MailMerge.MainDocumentType = wdFormLetters ActiveDocument.MailMerge.OpenDataSource Name:= _ "\\powervault2\home_pl\common\Referrals\Referals.x ls", _ ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _ AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _ WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _ Format:=wdOpenFormatAuto, Connection:= _ "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Us er ID=Admin;Data Source=\\powervault2\home_pl\common\Referrals\Refe rals.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Pa" _ , SQLStatement:="SELECT * FROM `Sheet1$`", SQLStatement1:="", SubType:= _ wdMergeSubTypeAccess With ActiveDocument.MailMerge .Destination = wdSendToPrinter .SuppressBlankLines = True With .DataSource .FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With Call Assessor End With End Sub Sub Assessor() Dim appWord As Object Dim myDoc As Object Set appWord = CreateObject("Word.Application") Set myDoc = appWord.Documents.Open("\\powervault2\home_pl\comm on\Referrals\Referal Agency - Assessor.doc") ActiveDocument.MailMerge.MainDocumentType = wdFormLetters ActiveDocument.MailMerge.OpenDataSource Name:= _ "\\powervault2\home_pl\common\Referrals\Referals.x ls", _ ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _ AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _ WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _ Format:=wdOpenFormatAuto, Connection:= _ "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Us er ID=Admin;Data Source=\\powervault2\home_pl\common\Referrals\Refe rals.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Pa" _ , SQLStatement:="SELECT * FROM `Sheet1$`", SQLStatement1:="", SubType:= _ wdMergeSubTypeAccess With ActiveDocument.MailMerge .Destination = wdSendToPrinter .SuppressBlankLines = True With .DataSource .FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With Call BuildingFireSafety End With End Sub "Michelle Hanan" wrote in message ... That seems to work great. I now need to put in a code to close the document at the end of the macro.I'm just not sure where this needs to be placed. Here is the ending of the macro. Thanks! FirstRecord = wdDefaultFirstRecord .LastRecord = wdDefaultLastRecord End With .Execute Pause:=False End With End Sub "Jim Thomlinson" wrote in message ... It needs an instance of Word in which to open the document... Give this a try... dim appWord as object dim myDoc as object set appWord = CreateObject("Word.Application") set myDoc = appWord.Documents.Open("\\powervault2\home_pl\comm on\Referrals\Referal Agency - Ecology.doc") -- HTH... Jim Thomlinson "Michelle Hanan" wrote: I have a macro that will not run consistantly, keeps getting runtime errror 429: activex component can't creat object. Are my set and dim codes wrong:?? Dim myDoc As Word.Document Set myDoc = Word.Documents.Open("\\powervault2\home_pl\common\ Referrals\Referal Agency - Ecology.doc") |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
runtime error: syntax error or access violation | Excel Programming | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming | |||
Unknown where is the problem on the Runtime error - Automation error | Excel Programming |