ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   form and module (https://www.excelbanter.com/excel-programming/320751-form-module.html)

Maileen[_3_]

form and module
 
Hi,

i wrote a function into a module and when i start my excel document, i
display a form.
this form allow me to perform some actions, especially to run a function.
when this function is executed, i want to hide my main form and display
progression of my function calculation on another form.
this second form should just display a progress bar and display a message
progression text like "150 records done over 40000..."

questions are :
1. how can i display on the excel document opening, my main form ?
2. how can i force user to have only access to the main form and not to
excel menu itself ?
3. how to actualize my 2nd form (progression form) with the progression bar
and the text ? usually excel doesn't update it and seems to be frozen, but
behind this it works normally but use 100% of CPU.

thanks a lot,

Maileen

K Dales[_2_]

form and module
 
1. The Workbook_Open event procedure happens as soon as you open the file, so
in the VB editor, in the project explorer select "ThisWorkbook" and add the
event procedu
Private Sub Workbook_Open()
MyUserForm.Show
End Sub

2. The CommandBars collection is a collection of all the menus and toolbars
- each one has an enabled and visible property - set one of these to false
for each of the commandbars you want to keep your users from accessing.

3. Excel keeps processing your code without updating the screen - so it is
"updating" just not repainting the screen so you can see the updates. I
assume you are using some sort of loop to do the calculations and update the
form - each time through the loop add these lines and I think you will be
able to watch the progress:
DoEvents
MyUserForm.Repaint

HTH
K Dales

"Maileen" wrote:

Hi,

i wrote a function into a module and when i start my excel document, i
display a form.
this form allow me to perform some actions, especially to run a function.
when this function is executed, i want to hide my main form and display
progression of my function calculation on another form.
this second form should just display a progress bar and display a message
progression text like "150 records done over 40000..."

questions are :
1. how can i display on the excel document opening, my main form ?
2. how can i force user to have only access to the main form and not to
excel menu itself ?
3. how to actualize my 2nd form (progression form) with the progression bar
and the text ? usually excel doesn't update it and seems to be frozen, but
behind this it works normally but use 100% of CPU.

thanks a lot,

Maileen



All times are GMT +1. The time now is 02:23 PM.

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