I have a userform in one workbook that opens a sheet in another workbook (name of other workbook is in public variable masterwb which is a full path name of type Variant)
I can view and edit the workbook and all its sheets manually from within my application with
Workbooks.Open (masterwb)
At this point I can select cells, tab or arrow key through them and edit them as normal. Afterwards I close it with he following (MasterName is a string which is the workbook name extracted from the full pathname)
Workbooks(MasterName).Close SaveChanges:=False
' False because I want the user to just view the sheet
However, when I use another userform within my application to edit data on a sheet (wb is type Workbook, sfxList is type Range, lPosition is type Long)
Set wb = Workbooks.Open(UserForm1.masterwb)
Set sfxList = wb.Worksheets("Master").Range("B:B")
sfxList.Cells(lPosition, 0).Value = TextBox1.Text
Set sfxList = Nothing
Workbooks(UserForm1.MasterName).Close SaveChanges:=True
' I also tried wb.Close SaveChanges:=True
I can still view the workbook from the original userform with the same code
Workbooks.Open (masterwb)
Now the scrollbars work and I can select cells, but I can no longer edit it or tab through it. Can someone tell me what changed and how I can restore the ability to tab through this sheet normally?
Bookmarks