【问题标题】:Paste linked single excel cell into powerpoint text将链接的单个 excel 单元格粘贴到 powerpoint 文本中
【发布时间】:2020-08-12 01:58:26
【问题描述】:

我正在尝试像这样复制一个 Excel 单元格:

到现有的幻灯片中,在现有的单元格中,如下所示:

我尝试做的是“特殊粘贴”,将链接粘贴在下图中。请注意,我需要手动将其拖到那里,这已经不需要了。

但结果是一个“假单元格”,我必须手动将其拖动到正确的位置,而不是像我需要的那样在常规文本中。有谁知道更好的解决方案来获得第二张图片中的自动化结果?

提前非常感谢!

【问题讨论】:

    标签: excel vba hyperlink powerpoint


    【解决方案1】:
    Dim xlsApp As Object
    Dim xlsWB As Object
    
    Set xlsApp = CreateObject("Excel.Application")
    Set xlsWB = xlsApp.Workbooks.Open(ActivePresentation.Path & "\" & "FileName.xlsx")
    
    ActivePresentation.Slides(1).Shapes("Subtitle").TextFrame.TextRange = "The excel sheet content should appear here within this text: " & xlsWB.Worksheets(1).Range("A1")
    
    xlsWB.Save
    xlsWB.Close
    xlsApp.Quit
    
    Set xlsWB = Nothing
    Set xlsApp = Nothing
    

    您可以更改幻灯片索引。您可以通过选择窗格自定义形状的名称。 使用vbNewLine 在行之间添加一个换行符。

    使用For Loops 自动执行此操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-14
      • 1970-01-01
      • 2015-04-14
      • 1970-01-01
      • 1970-01-01
      • 2017-06-08
      • 2017-10-08
      • 1970-01-01
      相关资源
      最近更新 更多