Hiding workbook while showing UserForm

Sam05

New Member
Joined
Feb 7, 2009
Messages
23
Hi, I have 2 questions:
1. I'm looking for a better way to get a UserForm (frmParts) to show right from the start as soon as I open the workbook while hiding the application. I use the following when I initialize the application:

Code:
Application.Visible = False
frmParts.Show

Any ideas how to accomplish this in a better way?

2. Later on, I add some parts to my inventory, but if I don't make the application visible, it doesn't save the data. So, I have to make it visible and then hide it again. Is there a right way to accomplish the save without having to unhide/hide the application? This is the applicable code I used (ComboBoxes & TextBoxes involved):

Code:
'copy the data to the database
Application.Visible = True
Application.ScreenUpdating = False

With ws 'ws=Inventory
  .Cells(1, 1).Value = Me.cboPart.Value 'Part Number
  .Cells(1, 2).Value = Me.cboLocation.Value 'Part Location
  .Cells(1, 3).Value = Me.txtQty.Value 'Quantity
End With

Sheets("Parts").Activate
ActiveWorkbook.Save

Application.Visible = False
Application.ScreenUpdating = True

Thank you in advance for your help,

Sam
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,215,847
Messages
6,127,264
Members
449,372
Latest member
charlottedv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top