BusinessObjects Board

Save for all users

Hi,

I have an urgent question: how do you automatically save all documents “for all users”. Is there a script for this?
I have to import al lot of documents and save them for all users somewhere on disk.

So a combination of "Save all " and “save for all users”

:?


Lia :netherlands: (BOB member since 2004-08-24)

try this sub:

Sub SaveAllForAll()

    On Error GoTo Error_Handler
    
    Dim strSavePath As String
    strSavePath = "C:\Program Files\Business Objects"
    Dim Success As Boolean
    Dim doc As Object
    Dim i As Integer
    For i = 1 To Application.Documents.Count
        Success = Application.Documents(i).SaveAs(strSavePath & "\" & Application.Documents(i).Name, 1)
        If Not Success Then
       ' MsgBox (Application.Documents(i).Name & "  did not save.")
        End If
    Next
    
Exit Sub
Error_Handler:
    Success = MsgBox(Err.Description, vbCritical)
End Sub

Regards
Dirk :slight_smile:


Dirk :south_africa: (BOB member since 2002-06-26)

Here is a small utility (attached below) that should do the trick.

Instructions for use:

  • Place all documents, along with the utility, in a separate sub-directory.
  • Open the utility, press Alt-F8, select the SaveForAllUsers macro, and click Run.
  • Macro will sequentially open all .rep files in the directory and perform a “save for all users” on each.

The code is in the utility, but I will include it here for reference:

Sub SaveForAllUsers()

    Dim PathName As String
    Dim RptName As String
    Dim Doc As Document

    PathName = ThisDocument.Path & "\"
    RptName = Dir(PathName & "*.rep")
    Do While RptName <> ""
        RptName = PathName &amp; RptName
        If RptName <> ThisDocument.FullName Then
            Set Doc = Application.Documents.Open(RptName, True, False)
            Call Doc.SaveAs(RptName, True)  'true is the "save for all users" flag
            Call Doc.Close
        End If
        RptName = Dir
    Loop

End Sub

Save For All Users.rep (38.0 KB)


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Moving this topic to the SDK forum, but leaving a shadow topic in Reporter.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

:smiley: :smiley:

Thank you so much!! this works fine for me.

Lia


Lia :netherlands: (BOB member since 2004-08-24)

Updated version of a “Save for All Users” utility that recursively processes a directory structure.

Also moving to the BOB’s Downloads forum.
Save for all users.rep (53.0 KB)


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

I have used this utility to great advantage in BO6.5.

I am now trying to use the BOXI r2 utility but got following error

Runtime error '430'
Class does not support Automation or does not support expected interface.

at following line
Set desApp = New Designer.Application

I checked and confirmed that BO Designer 11.5 library is included in the Tools - > References.

What else am I missing here?

PS: Sorry, posted in wrong thread. This was meant for Document a Universe using Excel thread


mkumar (BOB member since 2002-08-26)

Thanks a lot to share this utility. Very useful.


Giulia :it: (BOB member since 2007-08-10)

I receive the error FRM0008 while I execute this macro.
How can I open this file without error?

Thanks.
Giulia


Giulia :it: (BOB member since 2007-08-10)

im receiving following error whilce scheduling the report in XIR2
CAN ANYONE HELP ON THIS

Object failed to run due to an error while processing on the Job Server


nandaid (BOB member since 2009-08-27)

i don’t think such VBA embelded code in deski report can be scheduled. Is it working in an interactive way ?


bernard timbal :fr: (BOB member since 2003-05-26)