Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
runtime error 434, object does not support this method or property Janis Excel Discussion (Misc queries) 4 January 17th 08 04:10 PM
VBA error: "object doesn't support this property or method" Dave F Excel Discussion (Misc queries) 2 April 23rd 07 06:04 PM
object reference does not support this property or method [email protected] Excel Discussion (Misc queries) 2 June 14th 06 07:23 PM
Object doesn't support this property or method (Error 438) Kiran Excel Discussion (Misc queries) 1 July 12th 05 08:42 PM
Object doesn't support this property or method Rick Campbell Excel Programming 2 July 13th 03 11:53 PM


All times are GMT +1. The time now is 04:47 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"