ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ShowModal property (https://www.excelbanter.com/excel-programming/327307-showmodal-property.html)

Vj

ShowModal property
 
I have 150 Excel Workbooks which contain form and modules.

Is there any way to change the showModal property of one of the form in all
the workbooks through a vba macro.

Chip Pearson

ShowModal property
 
Try something like the following:

Sub AAA()
Dim WB As Workbook
Dim FName As String
FName = Dir("C:\Temp\*.xls") ' change as required
Do Until FName = ""
Set WB = Workbooks.Open(FName)
WB.VBProject.VBComponents("UserForm1") _
.Properties("ShowModal").Value = True ' or False
WB.Save
WB.Close
FName = Dir()
Loop
End Sub

Change the directory in the Dir function to your directory, and
change "UserForm1" to the name of the form.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"VJ" wrote in message
...
I have 150 Excel Workbooks which contain form and modules.

Is there any way to change the showModal property of one of the
form in all
the workbooks through a vba macro.





All times are GMT +1. The time now is 12:17 AM.

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