缺少参考错误 - Mac 上的 Powerpoint 2011 的 VBA(在 Windows 的 PPT 2007 中工作正常)

发布于 2024-11-19 09:12:36 字数 863 浏览 2 评论 0原文

对 VBA 返回 Mac 的事实感到兴奋,但在 Windows 的 Powerpoint 2007 中运行良好的代码时遇到问题(在下面的注释语句中给我一个“编译错误:用户定义的类型未定义”):

Private Function m_CreateStackedChart(SourceData As Excel.Range) As Boolean

    Dim pptShape As PowerPoint.Shape
    Dim pptChart As PowerPoint.Chart ' // This line causes the error
    Dim pptSlide As PowerPoint.Slide
    Dim pptData As PowerPoint.ChartData
    Dim shtData As Excel.Worksheet
    Dim lngRow As Long
    Dim lngCol As Long
    Dim lngOutRow As Long
    Dim lngOutCol As Long
    Dim lngTopRow As Long
    Dim lngNItems As Long
    Dim dblXaxisSize As Double
    Dim lngAxisFactor As Long
    Dim strHolderName As String
    Dim rngXData As Range
    Dim rngYData As Range
    Dim lngNRows As Long
    Dim lngSeries As Long
    Dim objDLabel As Object
    Dim strFormat As String
    ....
End Function

感谢任何帮助

Excited by the fact that VBA returned to Mac, but having trouble with code that works fine in Powerpoint 2007 for Windows (giving me a "Compile Error: User-defined type not defined" at the commented statement below):

Private Function m_CreateStackedChart(SourceData As Excel.Range) As Boolean

    Dim pptShape As PowerPoint.Shape
    Dim pptChart As PowerPoint.Chart ' // This line causes the error
    Dim pptSlide As PowerPoint.Slide
    Dim pptData As PowerPoint.ChartData
    Dim shtData As Excel.Worksheet
    Dim lngRow As Long
    Dim lngCol As Long
    Dim lngOutRow As Long
    Dim lngOutCol As Long
    Dim lngTopRow As Long
    Dim lngNItems As Long
    Dim dblXaxisSize As Double
    Dim lngAxisFactor As Long
    Dim strHolderName As String
    Dim rngXData As Range
    Dim rngYData As Range
    Dim lngNRows As Long
    Dim lngSeries As Long
    Dim objDLabel As Object
    Dim strFormat As String
    ....
End Function

Any help is appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

再可℃爱ぅ一点好了 2024-11-26 09:12:36

我认为您无法在 Mac PPT 2011 中使用图表做太多事情,至少截至 2011 年 7 月(应用第一个服务包之后)是这样。

.Chart 对象不会在 PowerPoint 2011 对象模型中显示。 PowerPoint 的 VBA 实现和 OM 似乎处于 Office 2007 第一个 Service Pack 发布之前的阶段。

I don't think you'll be able to do much with charts in Mac PPT 2011, at least not as it stands as of July 2011 (after applying the first service pack).

The .Chart object isn't revealed in the PowerPoint 2011 object model. PowerPoint's VBA implementation and OM seem to be at about the stage things were at in Office 2007 before the first service pack for it came out.

狼亦尘 2024-11-26 09:12:36

我刚刚偶然发现了这个线程,虽然这是一个令人失望的消息,但我刚刚检查了 PowerPoint:mac 2016,图表对象模型似乎在该产品中得到了很好的实现。

I've just stumbled across this thread and whilst it's disappointing news, I just checked PowerPoint:mac 2016 and the Chart object model appears to be pretty well implemented in that product.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文