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>
I have used this code in "Splash":
<code>
which gives me the following error. Run-time error '57121':
Application-defined or object-defined error
which points to this line of code
<code>
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>
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
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: