ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Only show userform after startup of app. (https://www.excelbanter.com/excel-programming/372627-only-show-userform-after-startup-app.html)

Arjan

Only show userform after startup of app.
 
Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands

Jim Thomlinson

Only show userform after startup of app.
 
The form is in the app so you cant't really have the form without the app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden instance
of Excel and they can't find it. So they try to open it again and it says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't do
it, just giving fair warning of some of the pitfalls... I personally would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands


Arjan

Only show userform after startup of app.
 
Jim,

That's clear..ok I won't :)
However, is it possible to minize the background window?



--
Arjan Bregman
the Netherlands


"Jim Thomlinson" wrote:

The form is in the app so you cant't really have the form without the app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden instance
of Excel and they can't find it. So they try to open it again and it says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't do
it, just giving fair warning of some of the pitfalls... I personally would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands


Arjan

Only show userform after startup of app.
 
Jim,

Me again...
Do you have anyother suggestions to make it apear to be just like a vb app?

Arjan Bregman
the Netherlands


"Jim Thomlinson" wrote:

The form is in the app so you cant't really have the form without the app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden instance
of Excel and they can't find it. So they try to open it again and it says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't do
it, just giving fair warning of some of the pitfalls... I personally would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands


Jim Thomlinson

Only show userform after startup of app.
 
IMO if you want it to look like a VB app there is no real substitute for
writing it in plain old fashioned VB. If you want you can have your VB app
interact with Excel if that is a requirement.

I guess what I am saying is that at the end of the day Excel should look and
feel like Excel. If that is not what you want then don't use Excel. While you
can blur the lines a little bit you can not remove the lines completely.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Jim,

Me again...
Do you have anyother suggestions to make it apear to be just like a vb app?

Arjan Bregman
the Netherlands


"Jim Thomlinson" wrote:

The form is in the app so you cant't really have the form without the app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden instance
of Excel and they can't find it. So they try to open it again and it says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't do
it, just giving fair warning of some of the pitfalls... I personally would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands


Tom Ogilvy

Only show userform after startup of app.
 
If you use

application.IgnoreRemoteRequests = True

then you can eliminate the user trying to open another workbook in Excel.

If you have your app close all other workbooks in that instance of excel,
then some more problems are eliminated.

If you design your application so there is minimal chance that it will crash
and handle any anticipated errors, then you can further eliminate problems
with this approach.

I don't see it as being quit so dangerous as Jim, but you need to make your
own decisions. That said, I haven't had problems with the kind of code you
show. Have you turned off screenupdating?

--
Regards,
Tom Ogilvy




"Arjan" wrote:

Jim,

That's clear..ok I won't :)
However, is it possible to minize the background window?



--
Arjan Bregman
the Netherlands


"Jim Thomlinson" wrote:

The form is in the app so you cant't really have the form without the app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden instance
of Excel and they can't find it. So they try to open it again and it says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't do
it, just giving fair warning of some of the pitfalls... I personally would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands


JLGWhiz

Only show userform after startup of app.
 
I'm not sure exactly what you are trying to accomplish, but if you only want
the UserForm to show in the screen, then size it to fill the screen. That
will hide all of the cells, but the frames, scroll bars, command bars, etc.
will still be visible.

"Arjan" wrote:

Jim,

Me again...
Do you have anyother suggestions to make it apear to be just like a vb app?

Arjan Bregman
the Netherlands


"Jim Thomlinson" wrote:

The form is in the app so you cant't really have the form without the app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden instance
of Excel and they can't find it. So they try to open it again and it says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't do
it, just giving fair warning of some of the pitfalls... I personally would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands


Jim Thomlinson

Only show userform after startup of app.
 
Agreed it can be done but it is not a project for the faint of heart or the
newly initiated. You need a good understanding of XL and to be relativley
adept at error handling and such. I have seen this generate a number of
problems for a colleague in the past. If you miss something or your code is
not bullet proof then the potential problems that are generated are not
necessarily easy to diagnose or fix.
--
HTH...

Jim Thomlinson


"Tom Ogilvy" wrote:

If you use

application.IgnoreRemoteRequests = True

then you can eliminate the user trying to open another workbook in Excel.

If you have your app close all other workbooks in that instance of excel,
then some more problems are eliminated.

If you design your application so there is minimal chance that it will crash
and handle any anticipated errors, then you can further eliminate problems
with this approach.

I don't see it as being quit so dangerous as Jim, but you need to make your
own decisions. That said, I haven't had problems with the kind of code you
show. Have you turned off screenupdating?

--
Regards,
Tom Ogilvy




"Arjan" wrote:

Jim,

That's clear..ok I won't :)
However, is it possible to minize the background window?



--
Arjan Bregman
the Netherlands


"Jim Thomlinson" wrote:

The form is in the app so you cant't really have the form without the app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden instance
of Excel and they can't find it. So they try to open it again and it says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't do
it, just giving fair warning of some of the pitfalls... I personally would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a window with
my excel file. however, when I close my userform the window with my excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands


NickHK

Only show userform after startup of app.
 
Arjan,
If you want the look/feel of a VB app, I'd go with Jim and say make a VB app
then.
If you need interaction with Excel, it is pretty straightforward with
Automation.
If the user does not need to see that Excel is running, hide your instance.
Otherwise, you can re-parent Excel to your app, to give a "contained" look.

NickHK

"Arjan" wrote in message
...
Jim,

Me again...
Do you have anyother suggestions to make it apear to be just like a vb

app?

Arjan Bregman
the Netherlands


"Jim Thomlinson" wrote:

The form is in the app so you cant't really have the form without the

app.
When you close the form you do not close the app. Rather the app is now
hidden. IMO hiding the app is a bad path to follow. There are just too

many
issues with doing this. A couple of the biggest a

1. The user opens another excel file which opens up in the hidden

instance
of Excel and they can't find it. So they try to open it again and it

says
that they can't. They get frustrated and start doing funky things like
opening a second instance of Excel. and try to open it in there and they

get
a read only copy...

2. Your form crashes and all of the open workbooks that they have are in

the
hidden instance of Excel that they can not get back...

What you are attempting to do is VERY problematic. I am not saying don't

do
it, just giving fair warning of some of the pitfalls... I personally

would
not follow this path.
--
HTH...

Jim Thomlinson


"Arjan" wrote:

Hi all,

I want my userform the only thing to show after I started my excel

file..

I use this code..

Private Sub Workbook_Open()
Application.Visible = False
StartForm.Show
End Sub

Some how there is an error because in the back I can still see a

window with
my excel file. however, when I close my userform the window with my

excel
file is instantly closed...

What am I doing wrong???

Thnx in advance..

Arjan Bregman
the Netherlands





All times are GMT +1. The time now is 06:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com