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?
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
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
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
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.