form locking out other sheets

synergy16

Active Member
Joined
Mar 17, 2016
Messages
420
Office Version
  1. 365
Platform
  1. Windows
good morning all. im having an issue that when a user opens a form taht i made based on VBA code, it locks them out from access to any other non-related excel sheets. is there a fix for this?
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Make the userform Modeless
Code:
Userform1.show 0
 
Upvote 0
Hi there. The form is opening in whats called 'modal form'. This meand all other excel sheets, forms etc are de-activated until the form is closed. To make the form 'modeless' you can add a parameter to your userform show code to read: 'Userform1.Show (0)'. This opens the form but still lets you switch to other sheets. Be very careful though that any code that the userform runs is fully qualified to refer to the correct workbook, sheet etc. as if you have anything that references activeworkbook etc. then this will act on whichever worksheet the user has active, which may not be what you want. Have a look at this for some more info: https://bettersolutions.com/vba/userforms/modeless.htm
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
ok so i set the proper worksheet to the code and used the name i set it to in reference to ranges and cells example ash.cells(g,2) i also added the userform line in to the initialize sub. but i am still having the same issue, i can not acces a different, unrelated excel sheet

Code:
Dim ash As Worksheet



'Set classobject = New class
    Private Sub UserForm_Initialize()
        includeFlag = False
        Set ash = Sheets("vendorPartTrack")
    End Sub
    Private Sub Workbook_Open()
        CUSTOM.Show (0)
    End Sub
 
Upvote 0
not sure if this will help or not but, i can access another excel sheet if i open a new excel file from the windows search bar function. i can also access any sheet if i open it via that new excel sheet. but anything that is currently open when i load the form, i cant access. i also can not open an existing excel file from explorer
 
Upvote 0
Redundant having seen post#7
 
Last edited:
Upvote 0
I've never come across that behaviour before, so unfortunately don't know what to suggest.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,293
Members
449,077
Latest member
Rkmenon

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