berty2000
Board Regular
- Joined
- Mar 29, 2011
- Messages
- 71
Hi
I have just upgraded to excel 2016 and Im having problems opening another workbook from a userform and making it the active one.
It opens it ok, but you cant type anything unless you change to another sheet first then back again, it seems to still be active on the original workbook.
Code works fine on Excel 2010
This is what I have been using.
I have just upgraded to excel 2016 and Im having problems opening another workbook from a userform and making it the active one.
It opens it ok, but you cant type anything unless you change to another sheet first then back again, it seems to still be active on the original workbook.
Code works fine on Excel 2010
This is what I have been using.
Code:
Private Sub CommandButton2_Click()
'Sickness Back To Work Interview
'unload form and remove shape
Unload Me
ActiveSheet.Shapes("Rectangle 3").Visible = False
Range("AC3").Select
'File Location
fname = "Back to work interview.xlsm"
fpath = "U:\Team Leader Dashboard\Miscellaneous\" & fname
On Error Resume Next ' drive or file may not be available. If so error msg
Set wb = Workbooks.Open(fpath)
If wb Is Nothing Then
MsgBox "File is Not Accessible"
GoTo handle
wb.Activate
End
End If
handle:
End Sub