• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 88
  • Last Modified:

Excel VBA Copy object through to Word Bookmark

Hi

I have the following code that adds a new smart art object to Excel
What VBA code would I use to copy the object through to a Word Bookmark in a new instance of Word

  Set oSALayout = Application.SmartArtLayouts(92)
    'Set oShp = ActiveWorkbook.ActiveSheet.Shapes.AddSmartArt(oSALayout)
    Dim cellleft As Integer: cellleft = Range("A1").Left
    Dim celltop As Integer: celltop = Range("A1").Top
    Set oShp = ActiveWorkbook.ActiveSheet.Shapes.AddSmartArt(oSALayout, cellleft, celltop, 550, 1300)

    Set QNodes = oShp.SmartArt.AllNodes
    For i = 1 To 5      'delete all included nodes
        oShp.SmartArt.AllNodes(1).Delete
    Next
0
Murray Brown
Asked:
Murray Brown
1 Solution
 
Rgonzo1971Commented:
HI,

Why don't you create it directly in word
Set oSALayout = Application.SmartArtLayouts(92)
Set oShp = ActiveDocument.Shapes.AddSmartArt(oSALayout, 0, 0, 550, 1300, ActiveDocument.Bookmarks("aa").Range)

Set QNodes = oShp.SmartArt.AllNodes
For i = 1 To 5      'delete all included nodes
    oShp.SmartArt.AllNodes(1).Delete
Next

Open in new window

Regards
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now