[Solved] Getting rid of the main window

Discuss the database features
Post Reply
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

[Solved] Getting rid of the main window

Post by mihmih »

Hi,

i have a base-file connected to mysql. Mysql is installed on the server on a different computer. And i have a lot of macros. I also have a start screen that starts with the base.

In this case is it possible to get rid of the main base window?
Last edited by RoryOF on Thu Dec 14, 2017 6:43 pm, edited 2 times in total.
Reason: Added green tick [RoryOF, Moderator]
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: getting rid of the main window

Post by Villeroy »

Embedded form documents can be saved as stand-alone documents. Unfortunately, this will disconnect the logical forms. My macro suite "FreeHSQLDB" has a little extra which takes care of this. Simply install the package and run the FreeForms macro. It will prompt you for a target folder. Any hierarchy of embedded form folders will be reflected in the target directory. The stand-alone form documents can be hyperlinked to each other and desktop links will work as usual.
Last edited by Villeroy on Mon May 28, 2018 3:50 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: getting rid of the main window

Post by Villeroy »

Stand-alone Writer reports: viewtopic.php?f=29&t=81229 (simple tables, very slow, not suitable for thousands of records).
Personally, I prefer Calc as reporting engine. Most flexible with a lot of extra features and good enough "pretty printing" capabilities.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Getting rid of the main window

Post by Nocton »

I use this bit of vbs script to get rid of the main window:

Code: Select all

Dim sFileName, sTitle

sFileName = "MyFile.odb"
sTitle = "ERROR"

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")

If Not oFSO.FileExists(sFileName) Then
	oShell.Popup sFileName & "  - file not found", 10, sTitle, vbCritical + vbSystemModal
	Wscript.Quit 1
End If

' run the file with quotes added 1/0 to toggle Base window visible or not
iRC = oShell.Run("""" & sFileName & """", 0, True)

' Return file error level when exiting script
Wscript.Quit iRC
OpenOffice 4.1.12 on Windows 10
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: Getting rid of the main window

Post by mihmih »

Thank you for your answers

Villeroy - where can i find this macro suite?
Does it also solve the problem of macros unrelated to transitions between forms and those that generate relevant reports?

Nocton - vbs in openoffice? I dont understand. Can you say more about your code?
LibreOffice 4.2 on Windows7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Getting rid of the main window

Post by Nocton »

Nocton - vbs in openoffice? I dont understand. Can you say more about your code?
The vbs script runs in Windows to open your application:
1. Copy the code into Notepad and change MyFile.odb to the Base filename you wish to pen.
2. Save with extension .vbs in the folder where your Base file is, e.g. START_myfile.vbs.
3. Now just double-click on START_myfile.vbs to run the script and your application will open with or without the main window according to the setting of 1 or 0 where indicated.
OpenOffice 4.1.12 on Windows 10
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: Getting rid of the main window

Post by mihmih »

thanks for the explanation, but I think I'm too stupid :)

I did what you wrote, but the main window and the start screen are opening to me all the time.

Do I need to change something in the following line?

Code: Select all

iRC = oShell.Run("""" & sFileName & """", 0, True)
should I add next zeros between quotes?
LibreOffice 4.2 on Windows7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: Getting rid of the main window

Post by Nocton »

Nothing should be changed. This script has worked OK on several PCs and running different versions of window.

Maybe I have misunderstood what you mean by the 'main window'. I thought you meant the Base window that gives access to the Tables, Forms, etc.
When I run the script only the window/form opens that I have set as my 'Main Menu' in the 'Open Document' event of the Base application. If that is indeed what you mean, then I have no idea why the script does not work on your system. If not, then please explain further what you would like to happen.

By the way, when opening like this then the user must finish use Ctrl+Q or File/Exit - just closing the window will leave OO still running.
OpenOffice 4.1.12 on Windows 10
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: Getting rid of the main window

Post by mihmih »

I mean exactly what you wrote - the Base window that gives access to the Tables, Forms, etc.

on another computer (where I wanted to apply it) works, thanks a lot!

I have a button to close all, with macro:

Code: Select all

Sub close

Dim oDesktop As Object, oDocs As Object
  Dim oDoc As Object, oComponents As Object
  
  oComponents = StarDesktop.getComponents()
  oDocs = oComponents.createEnumeration()
  Do While oDocs.hasMoreElements()
    oDoc = oDocs.nextElement()
    oDoc.dispose()
  Loop
Wait 1000           

Shell("c:\windows\system32\taskkill.exe",2,"/F /iM soffice.bin")
end sub 
LibreOffice 4.2 on Windows7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: [solved]Getting rid of the main window

Post by Nocton »

Pleased you have got it to work.
And your code to close OO down is a useful addition to this thread.
OpenOffice 4.1.12 on Windows 10
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Getting rid of the main window

Post by mihmih »

one more thing...i have a warning, when i open this vbs file:

"dont know who created this file, are you sure you want to open it?"

Can I get rid of this?
LibreOffice 4.2 on Windows7
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: [Solved] Getting rid of the main window

Post by Nocton »

There is a lot on the web about this problem. I have never had it, so cannot comment. Am also now using Windows 10.
OpenOffice 4.1.12 on Windows 10
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Getting rid of the main window

Post by mihmih »

one year later....

Code: Select all

Dim sFileName, sTitle

sFileName = "MyFile.odb"
sTitle = "ERROR"

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")

If Not oFSO.FileExists(sFileName) Then
   oShell.Popup sFileName & "  - file not found", 10, sTitle, vbCritical + vbSystemModal
   Wscript.Quit 1
End If

' run the file with quotes added 1/0 to toggle Base window visible or not
iRC = oShell.Run("""" & sFileName & """", 0, True)

' Return file error level when exiting script
Wscript.Quit iRC
this script worked very well for wndows7, now I have windows10 and it has stopped working, the main window opens as before. Can anyone know why this code does not work for windows10?
LibreOffice 4.2 on Windows7
mihmih
Posts: 111
Joined: Wed Feb 18, 2015 9:21 pm

Re: [Solved] Getting rid of the main window

Post by mihmih »

meybe it is because i have windows10 x64 and LibreOffice x84.

Is somewhere to download LibreOffice 4.4.X x64?
LibreOffice 4.2 on Windows7
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Getting rid of the main window

Post by Villeroy »

LibreOffice for Windows 64 started with version 5
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: [Solved] Getting rid of the main window

Post by Zizi64 »

Here are all of older versions of the LibreOffice:

https://downloadarchive.documentfoundat ... ffice/old/
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Getting rid of the main window

Post by Villeroy »

Stand-alone forms work without any Base window
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Nocton
Volunteer
Posts: 533
Joined: Fri Nov 05, 2010 10:27 am
Location: UK

Re: [Solved] Getting rid of the main window

Post by Nocton »

It works OK for Windows 10 on my PC.
OpenOffice 4.1.12 on Windows 10
Post Reply