Open Calc from a particular sheet showing a Dialog

Home Forums Excel Utility Open Calc from a particular sheet showing a Dialog

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #67792
    Anonymous
    Inactive

    Hi friends. As you can see the excel utilities prepared by me always open from a particular sheet, no matter where you closed or saved it earlier. Different user forms (dialogues) are also shown at the time of opening and closing of the utilities. Once I prepared the same for the Open Office users and now someone requested me to provide the codes or the worksheet in an unlocked condition in the link given below. Presently I am out of home and I shall share the unlocked worksheet here as soon as possible. However you may have a look at the locked worksheet and try to understand how does it work. Here is the link. http://user.services.openoffice.org/en/ … 25&t=48484

    #73621
    Anonymous
    Inactive

    Dear Som,
    I also want to open a worksheet from a particular sheet.As a result of my googling I reached your page and downloaded your attached spreadsheet.It is very Nice and Fantastic.I tried to work another calc file by copy paste the macro code START.But failed.I couldn’t create such a file.Then I tried to attach sheets to your document.But it was protected.Can you help me?

    I am telling the procedure by which I have created the attached worksheet.
    1. Select a particular cell at the page which you want to show at the beginning and define a name of range. I gave the name “som” in the attached sheet.
    2. Create two separate User forms and give them separate names. Here I gave names “start” and “close”.
    3. Create Command buttons for both the User forms.
    4. Create a Standard module and give a name. I gave the name “ASKWB” here.
    Now copy the entire code and paste in the module. Dont forget to change the names if you like to change them.

    sub Main
    document= ThisComponent.CurrentController.Frame
    dispatcher=createUnoService(“com.sun.star.frame.DispatchHelper”)
    dim args1(0) as new com.sun.star.beans.PropertyValue
    args1(0).Name = “DbName”
    args1(0).Value = “som”
    dispatcher.executeDispatch(document, “.uno:SelectDB”, “”, 0, args1())
    RunstartDlg
    ostartDlg.endExecute()
    End Sub

    Dim ostartDlg
    Sub RunstartDlg
    Dim oLib
    Dim oLibDlg
    DialogLibraries.loadLibrary(“Standard”)
    oLib = DialogLibraries.getByName(“Standard”)
    oLibDlg = oLib.getByName(“start”)
    ostartDlg = CreateUnoDialog(oLibDlg)
    ostartDlg.execute
    End Sub

    Sub ExitstartDlg
    ostartDlg.endExecute()
    End Sub

    Dim oendDlg
    Sub RunendDlg
    Dim oLib
    Dim oLibDlg
    DialogLibraries.loadLibrary(“Standard”)
    oLib = DialogLibraries.getByName(“Standard”)
    oLibDlg = oLib.getByName(“end”)
    oendDlg = CreateUnoDialog(oLibDlg)
    oendDlg.execute
    End Sub

    Sub ExitendDlg
    oendDlg.endExecute()
    End Sub

    5. Now save the codes and go the the worksheet. Click Tools> Customize> Event> Open Document> Macro> Select your worksheet (Here som magic)>Standard>ASKWB>Main>OK.
    Now Select “Close Document” >> Macro> Select your worksheet (Here som magic)>Standard>ASKWB>RunendDlg>OK.
    6. Save the whole and exit.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.