Running excel as an application

  • Thread starter Thread starter John
  • Start date Start date
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
 
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
 
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)
 
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?
 
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
 
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
 
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)
 
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
 
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
 
Back
Top