Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-25-2020, 11:11 AM
Pastor Pastor is offline PPT Macro wont change userform name Windows 10 PPT Macro wont change userform name Office 2019
Novice
PPT Macro wont change userform name
 
Join Date: Oct 2020
Posts: 4
Pastor is on a distinguished road
Default

John,

Here is the code that works in EXEC that I mentioned in my previous response that has worked for years. With my best attempts to modify the code as little as possible to get it to work in the ppt code module file It failed at the renaming of the newly created user form.

'************************************************* **********
'* PUT THIS CODE IN THE REBUILD MODULE... *
'* *
'************************************************* **********
'************************************************* ***
'* Rebuild the form *
'************************************************* ***
'* p_Rebuild_Form _
'* sFormName:=c_sFormName, _
'* sCaption:=c_sCaption, _
'* bShowModal:=False, _
'* bEnabled:=True, _
'* lBackColor:=vbBlue, _
'* lForeColor:=vbYellow, _
'* sTag:=c_sTag, _
'* iZoom:=100, _
'* iTop:=iTop, _
'* iLeft:=iLeft, _
'* iHeight:=iHeight, _
'* iWidth:=iWidth

'************************************************* **********
'* P_REBUILD_FORM *
'************************************************* **********
Public Sub p_Rebuild_Form( _
ByVal sFormName As String, _
ByVal sCaption As String, _
ByVal bShowModal As Boolean, _
ByVal bEnabled As Boolean, _
ByVal lBackColor As Long, _
ByVal lForeColor As Long, _
ByVal sTag As String, _
ByVal iZoom As Integer, _
ByVal iTop As Integer, _
ByVal iLeft As Integer, _
ByVal iHeight As Integer, _
ByVal iWidth As Integer)

'OBJECTS DECLARATIONS
Dim oForm As Object

'Create a FORM = .Add(3) /3 = FORM's type value
Set oForm = ThisWorkbook.VBProject.VBComponents.Add(3)

'Update the FORM Properties
With oForm

'FORM: IDENTIFICATION PROPERTIES
.Properties("Name") = sFormName
.Properties("Caption") = sCaption

'FORM: BEHAVIOR PROPERTIES
'Use SHOWMODAL = TRUE for form that must have
'all of the focus and when the user must be
'restristed in which form can be selected.
'Use SHOWMODAL = FALSE for when multiple forms
'are on display and the user can select any for
'that the user wants.
.Properties("ShowModal") = bShowModal
.Properties("Enabled") = bEnabled

'FORM: APPEARANCE PROPERTIES
.Properties("BackColor") = lBackColor
.Properties("ForeColor") = lForeColor

'FORM: MISCELLANEOUS PROPERTIES
.Properties("Tag") = sTag
.Properties("Zoom") = iZoom

'FORM: POSITION PROPERTIES
.Properties("StartUpPosition") = 0
.Properties("Top") = iTop
.Properties("Left") = iLeft
.Properties("Height") = iHeight
.Properties("Width") = iWidth

End With

'Let the operating system catch up
VBA.DoEvents

End Sub

Thanks.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
PPT Macro wont change userform name Change Userform Icon in Taskbar derajlance Word VBA 7 06-01-2019 08:02 PM
Change focus from userForm back to word document to see results. Hank Smith Word VBA 1 08-11-2014 05:00 AM
Change parent for control from frame to userForm? Cosmo Word VBA 0 05-30-2014 02:19 PM
PPT Macro wont change userform name proofing language wont change BigOldArt Word 2 01-18-2013 01:22 PM
[Word 2003] Macro's and a UserForm xanuex Word VBA 0 10-19-2009 05:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft