Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2015, 03:56 PM
macropod's Avatar
macropod macropod is offline Refer to cell in embedded Excel object within word Windows 7 64bit Refer to cell in embedded Excel object within word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #2  
Old 08-28-2015, 03:02 AM
catflap's Avatar
catflap catflap is offline Refer to cell in embedded Excel object within word Windows XP Refer to cell in embedded Excel object within word Office XP
Advanced Beginner
Refer to cell in embedded Excel object within word
 
Join Date: Aug 2015
Location: UK
Posts: 77
catflap is on a distinguished road
Default

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....
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Refer to cell in embedded Excel object within word Excel table: refer to a particular row? tinfanide Excel 10 08-05-2015 01:17 PM
Refer to cell in embedded Excel object within word If (C1 = refer to a cell in a range) then (show the description in C2) & (corresponding price in C3) lily Excel 9 10-23-2014 06:21 AM
Refer to cell in embedded Excel object within word Edit embedded Visio object in Word 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
Refer to cell in embedded Excel object within word Editing an embedded OLE object DugganSC Word VBA 1 08-29-2011 01:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft