sub rangetopresentation()
' set a vbe reference to microsoft excel object library
dim xlapp as excel.application
dim ppslide as slide
' reference existing instance of excel
set xlapp = getobject(, "excel.application")
' make sure a range is selected
if not typename(xlapp.selection) = "range" then
msgbox "please select a worksheet range and try again.", _
vbexclamation, "no range selected"
else
' can only paste into slide view
application.activewindow.viewtype = ppviewslide
' reference active slide
set ppslide = activepresentation.slides _
(application.activewindow.selection.sliderange.slideindex)
' copy the range as a piicture
xlapp.selection.copypicture appearance:=xlscreen, _
format:=xlpicture
' paste the range
ppslide.shapes.paste.select
' align the pasted range
application.activewindow.selection.shaperange.align msoaligncenters, true
application.activewindow.selection.shaperange.align msoalignmiddles, true
' clean up
set ppslide = nothing
end if
set xlapp = nothing
end sub
用户登录
还没有账号?立即注册
用户注册
投稿取消
| 文章分类: |
|
还能输入300字
上传中....
那晚越女说我?