将Excel表格自动传输到PowerPoint会导致不相等的边框宽度

我将自动发送Excel表格的过程自动化为一个PowerPoint演示文稿,因为我每天都需要它,复制/粘贴它非常无聊。

我正在使用下面的函数(通过在excel表单中的一个操作系统中启动)复制它:

Sub WorkbooktoPowerPoint() 'Step 1: Declare your variables Dim pp As Object Dim PPPres As Object Dim PPSlide As Object Dim xlwksht As Worksheet Dim MyRange As String Dim MyTitle As String 'Step 2: Open PowerPoint, add a new presentation and make visible Set pp = CreateObject("PowerPoint.Application") Set PPPres = pp.Presentations.Add pp.Visible = True 'Step 3: Set the ranges for your data and title MyRange = "B2:BH40" '<< 'Step 4: Start the loop through each worksheet For Each xlwksht In ActiveWorkbook.Worksheets xlwksht.Select Application.Wait (Now + TimeValue("0:00:1")) 'Step 5: Copy the range as picture xlwksht.Range(MyRange).CopyPicture _ Appearance:=xlScreen, Format:=xlPicture 'Step 6: Count slides and add new blank slide as next available slide number '(the number 12 represents the enumeration for a Blank Slide) SlideCount = PPPres.Slides.Count Set PPSlide = PPPres.Slides.Add(SlideCount + 1, 12) PPSlide.Select 'Step 7: Paste the picture and adjust its position PPSlide.Shapes.Paste.Select pp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True pp.ActiveWindow.Selection.ShapeRange.Top = 1 pp.ActiveWindow.Selection.ShapeRange.Left = 1 pp.ActiveWindow.Selection.ShapeRange.Width = 700 'Step 8: Add the title to the slide then move to next worksheet Next xlwksht 'Step 9: Memory Cleanup pp.Activate Set PPSlide = Nothing Set PPPres = Nothing Set pp = Nothing End Sub 

它工作的很好,但是我的问题是:那些有表格的表格被复制,并在表格的随机边框中显示粗体线条(想象一下,边框表格应该用细线和粗线表示,不应该是)。

看来,当我们使用放大和缩小,这个问题消失了,但在全屏幕演示文稿仍然存在。 对我来说,它看起来像一个Microsoft Excel的问题,但也许有人可以帮助…

非常感谢!

尝试改变步骤5来代替使用位图格式:

 'Step 5: Copy the range as picture xlwksht.Range(MyRange).CopyPicture _ Appearance:=xlScreen, Format:=xlBitmap