![]() |
|
#1
|
||||
|
||||
![]()
It's not clear to me how you'll achieve anything better via an embedded Excel object, since you'll have the same issues with variable-length content there. Granted, such an object can be re-scaled, but that doesn't address issues of text-wrapping and font sizes. That said, you could try code like:
Code:
Sub Demo() Application.ScreenUpdating = False Dim objOLE As Word.OLEFormat, objXL As Object Dim R As Long, C As Long, X As Long R = 1: C = 2 X = 100 With ActiveDocument With .InlineShapes(1) If Not .OLEFormat Is Nothing Then If Split(.OLEFormat.ClassType, ".")(0) = "Excel" Then Set objOLE = .OLEFormat objOLE.Activate Set objXL = objOLE.Object objXL.ActiveSheet.Cells(R, C).Value = X On Error Resume Next objOLE.Application.Quit End If End If End With End With Set objXL = Nothing: Set objOLE = Nothing Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
||||
|
||||
![]()
Sorry for late reply - got bogged down in another project now.
I'll give your code a try out as soon as I can. Only problem now if that we are due to upgrade to Office 2013 in the next week or two.... |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
tinfanide | Excel | 10 | 08-05-2015 01:17 PM |
![]() |
lily | Excel | 9 | 10-23-2014 06:21 AM |
![]() |
TimTDP | Visio | 12 | 01-26-2014 12:43 AM |
An embedded object's formatting gets jumbled | New Daddy | PowerPoint | 0 | 11-17-2013 08:13 PM |
![]() |
DugganSC | Word VBA | 1 | 08-29-2011 01:40 PM |