form and module

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 procedure:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top