Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Loading an Excel User Form

Hi,

I created an Excel user form and renamed it to "frmFormA". I want the user
form to show when I open the workbook. I use the following code in the
"ThisWorkbook" section of Microsoft Excel Objects in Visual Basic:

Private Sub loadWb()
Load UserForm1
UserForm1.Show
End Sub

I also tried to change the code to "frmFormA" in place of "UserForm1" in the
code. For some reason, none of them works.

Can someone help me with my problem?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Loading an Excel User Form

you need to put it in the workbook_open event

Private Sub Workbook_Open()
Load frmFormA
frmFormA.Show
End Sub


--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"AccessHelp" wrote:

Hi,

I created an Excel user form and renamed it to "frmFormA". I want the user
form to show when I open the workbook. I use the following code in the
"ThisWorkbook" section of Microsoft Excel Objects in Visual Basic:

Private Sub loadWb()
Load UserForm1
UserForm1.Show
End Sub

I also tried to change the code to "frmFormA" in place of "UserForm1" in the
code. For some reason, none of them works.

Can someone help me with my problem?

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Loading an Excel User Form

hi there

if you put the code below in the "ThisWorkbook" module it should work
for you, you need to put the code in the workbook open event for it to
run when the workbook opens. you can select from the built in events
for an object by using the two comboboxes at the top of the code pane.

Private Sub Workbook_Open()
frmFormA.Show vbModal
End Sub


hope this helps you out

Steve

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Loading an Excel User Form

Hi guys,

Thanks for your helps. They work perfectly.

"Incidental" wrote:

hi there

if you put the code below in the "ThisWorkbook" module it should work
for you, you need to put the code in the workbook open event for it to
run when the workbook opens. you can select from the built in events
for an object by using the two comboboxes at the top of the code pane.

Private Sub Workbook_Open()
frmFormA.Show vbModal
End Sub


hope this helps you out

Steve


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems loading user form Stu W Excel Programming 1 June 24th 07 04:10 AM
Transfer data to form from Excel range upon loading of form. Rob Crawford Excel Programming 2 October 24th 05 03:59 PM
Loading a calendar (user form) from another project (personal.xls) Ollie[_2_] Excel Programming 1 September 25th 05 09:33 PM
Loading Excel Data into a Form DLayne Excel Programming 2 November 4th 04 10:35 AM
Auto loading of a user form sometimes -\) Excel Programming 1 August 2nd 03 12:32 AM


All times are GMT +1. The time now is 09:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"