在Excel VBA中自动刷新Omniture Report Builder [英] Automating Omniture Report Builder Refresh in Excel VBA

查看:112
本文介绍了在Excel VBA中自动刷新Omniture Report Builder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel 2010工作簿,其中包含几个Adobe Omniture Report Builder(5.0.50.0)查询.我正在VBA中通过此工作簿的电子邮件编写更新和分发脚本,但无法刷新报表生成器部分.

I have an excel 2010 workbook with several Adobe Omniture Report Builder (5.0.50.0) queries in it. I'm scripting the update and distribution via email of this workbook in VBA and I'm having trouble getting the Report Builder portion to refresh.

Adob​​e提供了以下无效的代码;

Adobe provides the following code which doesn't work ;

Sub RefreshAllReportBuilderRequests()

 Dim addIn As COMAddIn
 Dim automationObject As Object
 Dim success As Boolean
 Set addIn = Application.COMAddIns("ReportBuilderAddIn.Connect")
 Set automationObject = addIn.Object
 success = automationObject.RefreshAllRequests(ActiveWorkbook)

End Sub

将'Success'从boolean更改为String可以使其运行,但仍然不会刷新任何内容.我还尝试过将Adobe.ReportBuilder.Bridge工作表函数调用为;

Changing 'Success' from boolean to String allows it to run but it still doesn't refresh anything. I've also tried calling the Adobe.ReportBuilder.Bridge worksheet function as;

Application.Run ("AsyncRefreshAll")

再次无效.我能够刷新报表的唯一方法是调用报表构建器加载项的功能区刷新按钮的execute方法,并猜测运行需要多长时间.

Again no effect. The only way I've been able to refresh the reports is by calling the execute method of the report builder add-in's refresh button of the ribbon and guessing how long it'll take to run.

Application.CommandBars("Adobe Report Builder Toolbar").Controls(5).Execute

Application.Wait (Now() + TimeValue("00:00:02"))

有人知道做这项工作的更好方法吗?

Anyone know of a better way to make this work?

推荐答案

上周我遇到了同样的问题,但是现在已经解决了. 没错,成功不是布尔值,而是字符串.我通知了Omniture,他们更改了在线文档(但最后两个代码中仍然存在相同的问题:

I had the same issue last week, but now solved. You're right, success is not a boolean, it's a string. I notified Omniture about this and they changed their online documentation (but there's still the same issue in the two last codes : https://helpx.adobe.com/analytics/kb/visual-basic-macros-reportbuilder.html).

我将暗淡的成功更改为字符串,现在可以使用了!这是我使用的宏:

I changed the dim success as a string and now it works ! Here is the macro I use :

Sub RBRefresh()
    Dim addIn As COMAddIn
    Dim automationObject As Object
    Dim success As String
    Set addIn = Application.COMAddIns("ReportBuilderAddIn.Connect")
    Set automationObject = addIn.Object
    success = automationObject.RefreshAllRequests(ActiveWorkbook)
End Sub

所以我认为这不再是宏问题,也许是Excel问题?

So I think it's not a macro issue anymore, maybe an Excel issue ?

这篇关于在Excel VBA中自动刷新Omniture Report Builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆