cancel
Showing results for 
Search instead for 
Did you mean: 

Live Office Macro to refresh with prompts?

Former Member
0 Kudos

I've seen this asked a few time on here over the past several years but no answer. So thought I would give it a shout again.

I've been using code very simillar to the code here:

http://www.forumtopics.com/busobj/viewtopic.php?t=198349

which has been great for refreshing live office dahsboards.

But is there a way to automate if the dasboard is built off of Web Intelligence that has prompts? For example, when I refresh All Objects I get the prompt to select periods. I'd like to supress this. Any examples/documenation or point me to a specific part of the COM object would be great.

Here is where I am so far. The problem is that when it refreshes the the prompt window displays. I'd like to autmate that.

' Usual Excel code for declaring, opening, ect......

Set BobJ = XLApp.COMAddIns("CrystalOfficeAddins.CrystalComAddin.7").Object

BobJ.Logon "UserName","Password"

' --> SET MY PROMPT/PARAMETERS HERE

BobJ.LiveObjects.Refresh

BobJ.LogOff

'Usual Excel clean up down here

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dermot,

In case you are interested:

Add the webi_module 1.0 Type Library reference to your code and use the following as starting point to write your own:


Dim loPrompt, loPromptValues As Object


Set loPrompt = BobJ.WebiAddinPrompts.GetItem(0)

Set loPromptValues = loPrompt.CurrentValues.GetItem(0)

loPromptValues.Value = "Your value"


Then go further with your refresh code.


I got the answer here from user djikstra

Fill LiveOffice prompt with VBA (vb.NET)

Former Member
0 Kudos

Hi, Could you ever find any solution/workaround to this question?

I have a similar task to solve: refresh Word documents including some Webi reports, while filling out prompts from a .Net application.

I found out that the connection details, including the prompts are stored in a document variable called "CrystalPersist" in an xml-like format, but I didn't find anything that turns off the prompt screen.

Thanks,

Marton

Former Member
0 Kudos

You have gotten farther then me. Our workaround has been to only use web intelligence reports that don't have prompts. We created relative filters etc... Not ideal.

Can you share your code for how you set CrystalPersists? I don't see it in the IDocument object.

Thanks,

Dermot

Former Member
0 Kudos

Dermot,

The document variable was a dead end and it is part of the Word document (Document.Variables). I didn't find anything useful that suppresses the prompt screen.

In Excel, you can link prompt values to cells, change the value in these cells by controlling Excel itself, and refresh your document with the Liveobjects.Refresh method.

However, I was stuck with Word, as there's no way to avoid the prompt windows to appear. So I ended up with a code that started another thread before calling the Refresh method, waited in the background for the LiveOffice window, then with SendKey, it filled the prompt and started the actual refresh.

I admit, it is not nice, but at least works.

If anyone from SAP looks at this post, please provide a better solution

Greetings,

Marton