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

余生颓废 提交于 2021-02-10 11:46:53

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/56265048/copying-a-visio-page-and-pasting-it-in-excel-as-an-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!