C
Chad Knudson
I'm generating reports in Excel and one of them has an embedded Word
document. I can create the embedded Word document just fine but I don't end
up with the document painting in Excel, I have just a white box. If I click
on the embedded Word document to activate it, all of my text is there and
clicking away leaves me with the desired result. What am I missing to get
Word to paint this? I'm inside a section that has Excel's
Application.ScreenUpdating = False in case that affects anything.
(wsReports is an Excel worksheet)
Dim shpEmbeddedWordDoc As Shape
Dim objWord As Object
Set shpEmbeddedWordDoc=
wsReports.Shapes.AddOLEObject(ClassType:="Word.Document.8", Left:=334#,
Top:=4977#, Width:=320#, Height:=144#)
Set objWord = wsReports.OLEObjects(1).Object
objWord.Activate
objWord.StoryRanges(1).Text = "This is the contents of the document"
I seem to be missing something to get this to initially draw.
document. I can create the embedded Word document just fine but I don't end
up with the document painting in Excel, I have just a white box. If I click
on the embedded Word document to activate it, all of my text is there and
clicking away leaves me with the desired result. What am I missing to get
Word to paint this? I'm inside a section that has Excel's
Application.ScreenUpdating = False in case that affects anything.
(wsReports is an Excel worksheet)
Dim shpEmbeddedWordDoc As Shape
Dim objWord As Object
Set shpEmbeddedWordDoc=
wsReports.Shapes.AddOLEObject(ClassType:="Word.Document.8", Left:=334#,
Top:=4977#, Width:=320#, Height:=144#)
Set objWord = wsReports.OLEObjects(1).Object
objWord.Activate
objWord.StoryRanges(1).Text = "This is the contents of the document"
I seem to be missing something to get this to initially draw.