Running excel as an application

J

John

I have developed what is essentially an application using excell
workbooks.

Start page is a form with buttons leading the user to further forms
where they may enter data, raise graphs or print the forms. The user
never needs to access the workbooks where the data is held.

How can I now turn this into a stand alone application with no menus,
toolbars or view of the workbooks. All the commands the user may need
are generated as tool buttons. However I don't want this setup to
affect my use of other excel spreadsheets.

Thanks for you help.

John
 
S

Sharad

Since it is VBA, it will need excel to run, to run your program. You
can't make it an stand alone application as such. For that you could
have done the code in stand alone VB.

What however you can do is hide 'that' workbook. In the Workbook_Open
procedure add following line at the top:

Application.Windows(Me.Name).Visible = False

Sharad
 
B

Bob Phillips

As you want to raise graphs etc., you need Excel, so why bother?

You can force the form as modal regardless of version, so it will always be
to the front, and stop workbook input.

The other way would be to create a VB app, but you need a full version of VB
for that, and you would still need to interact with an Excel app (although
you can keep this non-visible), which will require automation, which makes
it a lot more code intensive.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

John

Since it is VBA, it will need excel to run, to run your program. You
can't make it an stand alone application as such. For that you could
have done the code in stand alone VB.

What however you can do is hide 'that' workbook. In the Workbook_Open
procedure add following line at the top:

Application.Windows(Me.Name).Visible = False

Thanks Sharad

Your'e right I will have to open Ecel but that is not a problem.

What about hiding the menus and tool bars?
 
S

Sharad

If you hide menus and toolbars, these will affect all other workbooks
the user opens.
Is this OK for you? If not, better leave it with hiding that workbook as
I told in earlier post.

In case that when the user runs this particular workbook, you think that
it is OK to hide menus and toolbars, there is a better way to hide
complete excel application itself.

Change the topmost earlier line which I told in workbook_open procedure
to:
Application.Visible = False

But in your userforms, DON'T FORGET the below line in Userform_Terminate
Procedure, in each of the userforms.

Application.Visible = True

Sharad
 
J

John

As you want to raise graphs etc., you need Excel, so why bother?

You can force the form as modal regardless of version, so it will always be
to the front, and stop workbook input.

The other way would be to create a VB app, but you need a full version of VB
for that, and you would still need to interact with an Excel app (although
you can keep this non-visible), which will require automation, which makes
it a lot more code intensive.

Thanks Bob

Am I able to hide tools and menues just for this app. though.

John
 
B

Bob Phillips

John,

You could add code like this to your form which would hide the Excel app and
reveal it when the form shuts down

Private Sub UserForm_Initialize()
Parent.Application.Visible = False
End Sub

Private Sub UserForm_Terminate()

Parent.Application.Visible = True
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
J

John

If you hide menus and toolbars, these will affect all other workbooks
the user opens.
Is this OK for you? If not, better leave it with hiding that workbook as
I told in earlier post.

In case that when the user runs this particular workbook, you think that
it is OK to hide menus and toolbars, there is a better way to hide
complete excel application itself.

Change the topmost earlier line which I told in workbook_open procedure
to:
Application.Visible = False

But in your userforms, DON'T FORGET the below line in Userform_Terminate
Procedure, in each of the userforms.

Application.Visible = True

Thanks again
 
S

Salty Dog

You can code the toolbars, headers and all that to not be displayed.
Then upon closing the worksheet, code in a section to reset all the
options you turned off..

I do this on a couple of fillable spreadsheets that I generated a VB
form process for..

Example:

-----------------
On Open Worksheet
-----------------

Private Sub Worksheet_Activate()
With ActiveWindow
.DisplayGridlines = True
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = False
.DisplayHeadings = False
.DisplayFormulas = False
End With
End Sub
-------------------------------------------------

-----------------
On Close Workbook
-----------------

Private Sub Workbook_BeforeClose(Cancel As Boolean)
With ActiveWindow
.DisplayGridlines = True
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayWorkbookTabs = True
.DisplayHeadings = True
.DisplayFormulas = True
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top