cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to read save data message log?

gajendra_moond
Contributor
0 Kudos
541

Hi

I have a requirement to read the message displayed in the pop-up window when you click "Save Data". For instance, I would like to capture the message as shown in the image below:

The first window shows the count of changed records/comments:

On clicking "Yes", the log is displayed.

I want to capture the save results using VBA only.

Your help and time is appreciated.

Regards

Gajendra

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Gajendra,

Easy:

Option Explicit

Dim api As New FPMXLClient.EPMAddInAutomation

Dim submres() As FPMXLClient_OlapUtilities.SubmitResult 'Array!!!

Public Sub SubmitData()

Dim lngTemp As Long

submres = api.SubmitAndRefreshWorkBook(ThisWorkbook)

For lngTemp = 0 To UBound(submres)

    MsgBox CStr(submres(lngTemp).AcceptCount) & " " & CStr(submres(lngTemp).ApplicationName)

Next lngTemp

End Sub

You also have:

submres(lngTemp).ErrorMessage

submres(lngTemp).RejectCount

submres(lngTemp).RejectRecords

...

Vadim

gajendra_moond
Contributor
0 Kudos

This is perfect Vadim.

Thank you very much. I totally missed out on FPMXLClient_OlapUtilities.

Just one additional question - you are using Submit and Refresh function. I tried using only submit(SaveWorksheetData/SaveWorkbookData) and it was throwing error. I would be executing multiple uploads and would like to save time on template refresh. Could you point out the error since these are no parameter functions.

Regards

Gajendra

former_member186338
Active Contributor
0 Kudos

SaveWorkbookData/SaveWorksheetData is a Sub, not a function

Nothing will be returned!

SubmitAndRefreshWorkBook

SubmitAndRefreshWorkSheet

...

Are functions returning array - submitresult...

Use Object browser!

Vadim

gajendra_moond
Contributor
0 Kudos

Object browser for Submitresult did not help me much. However, I am trying to interrupt refresh using BEFORE_REFRESH if that works.

Regards

Gajendra

former_member186338
Active Contributor
0 Kudos

Just assing false to before_refresh

former_member186338
Active Contributor
0 Kudos

Object browser screenshot:

Answers (0)