ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide the spreadsheet (https://www.excelbanter.com/excel-programming/373568-hide-spreadsheet.html)

David

Hide the spreadsheet
 
I was wondering if it would be possible to hide the normal excel window
while a macro was running. Thanks

- David


Tom Ogilvy

Hide the spreadsheet
 
Application.Visible = False

or

Sub ABC()
Application.WindowState = xlMinimized
For i = 1 To 10000000
j = j + 1
Next
Application.WindowState = xlNormal
End Sub


if you are doing a lot of selecting just try using
Application.ScreenUpdating = False

Sub MyExistingSub()
Application.Screenupdating = False

' current commands

Application.Screenupdating = True
End Sub

--
Regards,
Tom Ogilvy


"David" wrote in message
ps.com...
I was wondering if it would be possible to hide the normal excel window
while a macro was running. Thanks

- David




Mike Fogleman

Hide the spreadsheet
 
Tom, that would be
i = i + 1

This creates a kind of 'Wait' command adjusting the length of time with the
number.

Mike F
"Tom Ogilvy" wrote in message
...
Application.Visible = False

or

Sub ABC()
Application.WindowState = xlMinimized
For i = 1 To 10000000
j = j + 1
Next
Application.WindowState = xlNormal
End Sub


if you are doing a lot of selecting just try using
Application.ScreenUpdating = False

Sub MyExistingSub()
Application.Screenupdating = False

' current commands

Application.Screenupdating = True
End Sub

--
Regards,
Tom Ogilvy


"David" wrote in message
ps.com...
I was wondering if it would be possible to hide the normal excel window
while a macro was running. Thanks

- David






Tom Ogilvy

Hide the spreadsheet
 
No on the correction, i is adjusted by the FOR loop
adding to j was some dummy work - yes, it is just to cause a delay. It was
for demonstration purposes only.

--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
m...
Tom, that would be
i = i + 1

This creates a kind of 'Wait' command adjusting the length of time with
the number.

Mike F
"Tom Ogilvy" wrote in message
...
Application.Visible = False

or

Sub ABC()
Application.WindowState = xlMinimized
For i = 1 To 10000000
j = j + 1
Next
Application.WindowState = xlNormal
End Sub


if you are doing a lot of selecting just try using
Application.ScreenUpdating = False

Sub MyExistingSub()
Application.Screenupdating = False

' current commands

Application.Screenupdating = True
End Sub

--
Regards,
Tom Ogilvy


"David" wrote in message
ps.com...
I was wondering if it would be possible to hide the normal excel window
while a macro was running. Thanks

- David








David

Hide the spreadsheet
 
Thanks Tom that worked great. Also is there any way to run a macro when
excel first starts instead of having to have the user click run.
Thanks.

- David
Tom Ogilvy wrote:
No on the correction, i is adjusted by the FOR loop
adding to j was some dummy work - yes, it is just to cause a delay. It was
for demonstration purposes only.

--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
m...
Tom, that would be
i = i + 1

This creates a kind of 'Wait' command adjusting the length of time with
the number.

Mike F
"Tom Ogilvy" wrote in message
...
Application.Visible = False

or

Sub ABC()
Application.WindowState = xlMinimized
For i = 1 To 10000000
j = j + 1
Next
Application.WindowState = xlNormal
End Sub


if you are doing a lot of selecting just try using
Application.ScreenUpdating = False

Sub MyExistingSub()
Application.Screenupdating = False

' current commands

Application.Screenupdating = True
End Sub

--
Regards,
Tom Ogilvy


"David" wrote in message
ps.com...
I was wondering if it would be possible to hide the normal excel window
while a macro was running. Thanks

- David







Tom Ogilvy

Hide the spreadsheet
 
in the VBE, double click on the Thisworkbook entry in the project explorer
(on the left ) entry for your project. This will bring up the ThisWorkbook
code module. in the left dropdown at the top of the module select Workbook,
in the right dropdown at the top of the module select Open. This will put
in the declaration for the Workbook_Open event which fires when the workbook
is opened.

Private Sub Workbook_Open()

End sub

You can add code here or call your macro

Private Sub Workbook_Open()
MyMacro
End sub

See Chip Pearson's page on events for a general overview
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"David" wrote in message
oups.com...
Thanks Tom that worked great. Also is there any way to run a macro when
excel first starts instead of having to have the user click run.
Thanks.

- David
Tom Ogilvy wrote:
No on the correction, i is adjusted by the FOR loop
adding to j was some dummy work - yes, it is just to cause a delay. It
was
for demonstration purposes only.

--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
m...
Tom, that would be
i = i + 1

This creates a kind of 'Wait' command adjusting the length of time
with
the number.

Mike F
"Tom Ogilvy" wrote in message
...
Application.Visible = False

or

Sub ABC()
Application.WindowState = xlMinimized
For i = 1 To 10000000
j = j + 1
Next
Application.WindowState = xlNormal
End Sub


if you are doing a lot of selecting just try using
Application.ScreenUpdating = False

Sub MyExistingSub()
Application.Screenupdating = False

' current commands

Application.Screenupdating = True
End Sub

--
Regards,
Tom Ogilvy


"David" wrote in message
ps.com...
I was wondering if it would be possible to hide the normal excel
window
while a macro was running. Thanks

- David









David

Hide the spreadsheet
 
Thanks Tom.

- David
Tom Ogilvy wrote:
in the VBE, double click on the Thisworkbook entry in the project explorer
(on the left ) entry for your project. This will bring up the ThisWorkbook
code module. in the left dropdown at the top of the module select Workbook,
in the right dropdown at the top of the module select Open. This will put
in the declaration for the Workbook_Open event which fires when the workbook
is opened.

Private Sub Workbook_Open()

End sub

You can add code here or call your macro

Private Sub Workbook_Open()
MyMacro
End sub

See Chip Pearson's page on events for a general overview
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"David" wrote in message
oups.com...
Thanks Tom that worked great. Also is there any way to run a macro when
excel first starts instead of having to have the user click run.
Thanks.

- David
Tom Ogilvy wrote:
No on the correction, i is adjusted by the FOR loop
adding to j was some dummy work - yes, it is just to cause a delay. It
was
for demonstration purposes only.

--
Regards,
Tom Ogilvy

"Mike Fogleman" wrote in message
m...
Tom, that would be
i = i + 1

This creates a kind of 'Wait' command adjusting the length of time
with
the number.

Mike F
"Tom Ogilvy" wrote in message
...
Application.Visible = False

or

Sub ABC()
Application.WindowState = xlMinimized
For i = 1 To 10000000
j = j + 1
Next
Application.WindowState = xlNormal
End Sub


if you are doing a lot of selecting just try using
Application.ScreenUpdating = False

Sub MyExistingSub()
Application.Screenupdating = False

' current commands

Application.Screenupdating = True
End Sub

--
Regards,
Tom Ogilvy


"David" wrote in message
ps.com...
I was wondering if it would be possible to hide the normal excel
window
while a macro was running. Thanks

- David









All times are GMT +1. The time now is 09:42 AM.

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