Suresh Rajan
Suresh Rajan

Reputation: 21

Copying a visio page and pasting it in excel as an image

I'm trying to copy all shapes in a visio page and paste it in Excel as an image. The image should be a close replica of the visio drawing. Looking for Excel vba script to do this. I'm able to open visio, access shapes information etc, but stuck in copying and pasting all shapes to excel as a single image

I tried the following:

 For j = 1 To intShapeCount  'Get count of shapes on page
        Set vsoConnectFrom = vsoShapes.Item(j)
        vsoConnectFrom.Copy(visCopyPasteNoTranslate)
        CIwb.Worksheets("Current FlowChart").Paste
  Next j

This code is pasting all shapes to a single spot and the shapes are not connected. Hence looking for code that would just copy all shapes and paste as image into excel

Upvotes: 2

Views: 593

Answers (1)

AAA
AAA

Reputation: 3670

'Assuming your page object is named vsoPage
'This embeds the visio drawing
vsoPage.CreateSelection(visSelTypeAll).Copy
CIwb.Worksheets("Current FlowChart").Paste

Upvotes: 1

Related Questions