CommandButton splash screen

Russell_Leaves

New Member
Joined
May 1, 2015
Messages
19
Hi


I am trying to have a command button open as a splash screen when I open excel. I am using the 2007 version. I have cleared all old files per issues with active-x from Dec 2014.


Problem 1: I would like the commandbutton centered both vertically and horizontal so that it does not matter what the screen resolution of the computer is. The commandbutton should always be in the middle. I originally asked this question>
http://www.mrexcel.com/forum/excel-...ontal-centered-command-button.html?highlight= ,with no responses.


I have used this code in "This WorkBook":
<code>
Code:
Private Sub Workbook_Open()
Sheets("Splash").Visible = True
Sheets("Splash").Select
Sheets("Sheet1").Visible = False
End Sub





I have used this code in "Splash":
<code>
Code:
Private Sub CommandButton1_Click()
ActiveSheet.Forms("CommandButton.1").Visible = False
Sheets("Sheet1").Visible = True
Sheets("Sheet1").Select
Sheets("Splash").Visible = False
End Sub


Private Sub Worksheet_Activate()
With CommandButton1
  .Visible = True
  .StartUpPosition = 0
  .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
  .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
  .Show
End With
End Sub
which gives me the following error. Run-time error '57121':
Application-defined or object-defined error




which points to this line of code
<code>
Code:
Private Sub Workbook_Open()
Sheets("Splash").Visible = True


Problem 2: On the commandbutton I would like to display an animated gif. I could probably get this to work by displaying several different images to get an animated effect. I would rather use the one image file that is already animated. I have been looking for a solution for several weeks with no luck. I originally asked this question> http://www.mrexcel.com/forum/excel-questions/853103-animations-excel.html?highlight= ,with no responses.


I hope I have articulated my problems/issues. Please respond if further clarification is required.


Any assistance to both problems is appreciated.


Thanks</code></code></code>
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi


Well, after much effort and crashing of excel, I have worked out the positioning of the CommandButton.


Still looking for an answer on the animated image though.


The code that worked and positioned everything correctly follows.


In "This Workbook"
Code:
Private Sub Workbook_Open()
Sheets("Splash").Visible = True
Sheets("Splash").Select
Sheets("Sheet1").Visible = False
End Sub



In "Splash"
Code:
Private Sub CommandButton1_Click()
ActiveSheet.Shapes("CommandButton1").Visible = False
Sheets("Sheet1").Visible = True
Sheets("Sheet1").Select
Sheets("Splash").Visible = False
End Sub


Private Sub Worksheet_Activate()
With CommandButton1
  .Visible = True
  .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
  .Top = Application.Top + (0.5 * Application.Height) - (1 * .Height)
End With
End Sub


I have not found a solution for Problem 2: On the commandbutton I would like to display an animated gif. I could probably get this to work by displaying several different images to get an animated effect. I would rather use the one image file that is already animated.


Thanks
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top