Pastespecial how to not mess up manual format

nguyen_tri

New Member
Joined
Oct 17, 2017
Messages
9
I am trying to paste special and manually format the object to a certain scale. However, the scale size always changes. Here is my code:
Code:
With Selection.Tables(1).Range.Cells(2).Range    .PasteSpecial Link:=True, DataType:=wdPasteOLEObject, _
    Placement:=wdFloatOverText, DisplayAsIcon:=False
    With .ShapeRange(1)
    .LockAspectRatio = msoFalse
    .ScaleWidth 1.03, msoTrue
    .ScaleHeight 0.95, msoTrue
    .LockAspectRatio = msoTrue
    .ConvertToInlineShape
    End With
Please help me.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Most likely, the problem you're having is due to the object being linked; the field code that maintains the link maintains not only the data but also the formatting. There are also some things you can do through the GUI that there's no VBA support for. This seems to be one of them. Even manipulating the resulting LINK field's code won't produce the result you're after. Furthermore, even if you were able to, the linked object's format is liable to change when the Excel workbook is changed. What you may need to do is to paste your range as an unlinked table in its own right, which you can then re-scale, then replace that table's individual cell contents with links to your Excel workbook. Either that or resign yourself to re-scaling the linked data manually after running your existing code.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top