Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Time Error 438 - Object doesn't support the property or method
All the calls to Word objects from Excel run except the
run time error 438 on Line: Selection.TypeText Text:=Labels(i - 1) This line functions if ececuted within a Word thread. For i = 1 To MaxLabelCount LabelModCount = i Mod 80 If LabelModCount = 1 Then LabelDocCount = LabelDocCount + 1 If LabelDocCount 1 Then Application.PrintOut Filename:="", Range:=wdPrintAllDocument, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _ PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Call CloseWordDocument End If Call OpenWordDocument(LabelDocCount) Windows(1).Activate End If LabelRowPos = i Mod 4 If LabelRowPos = 1 Then If Not LabelModCount = 1 Then Selection.MoveRight Unit:=wdCell End If Else Selection.MoveRight Unit:=wdCell Selection.MoveRight Unit:=wdCell End If Selection.TypeText Text:=Labels(i - 1) Next Application.PrintOut Filename:="", Range:=wdPrintAllDocument, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _ PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Call CloseWordDocument Exit Sub ErrorReturn: Exit Sub End Sub Sub CloseWordDocument() ' ' CloseWordDocument Sub ' Sub Created 9/6/2004 by Paul Cottier ' ActiveDocument.Close End Sub Sub OpenWordDocument(DocNum As Integer) ' ' OpenWordDocument Sub ' Sub recorded 9/6/2004 by Paul Cottier ' Dim docname As String docname = TargetName & CStr(DocNum) ChangeFileOpenDirectory _ ApplicationFolder Documents.Open Filename:=docname, ConfirmConversions:=False, ReadOnly _ :=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate _ :="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="" _ , Format:=wdOpenFormatAuto End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
runtime error 434, object does not support this method or property | Excel Discussion (Misc queries) | |||
VBA error: "object doesn't support this property or method" | Excel Discussion (Misc queries) | |||
object reference does not support this property or method | Excel Discussion (Misc queries) | |||
Object doesn't support this property or method (Error 438) | Excel Discussion (Misc queries) | |||
Object doesn't support this property or method | Excel Programming |