David Miles
New Member
- Joined
- Aug 19, 2016
- Messages
- 1
Hi Guys,
Can you help with the following code. Whenever it opens the workbook opens and is then hidden behind the original userform coding page instead of in the foreground
Can you help with the following code. Whenever it opens the workbook opens and is then hidden behind the original userform coding page instead of in the foreground
Rich (BB code):
Rich (BB code):
Unload UserForm1
Dim WbookCheck As Workbook
On Error Resume Next
Set WbookCheck = Workbooks("C:\Users\gps943205\Desktop\OCVNM\DOSSIER FOLDERS\OCVNM-DC DOCUMENT CONTROL\OCVNM-DC 18 HEALTH\OCVNM-DC 18 C - MATERIAL SAFETY DATA SHEET\OCVNM CHEMICALS - MSDS.xls")
On Error GoTo 0
If WbookCheck Is Nothing Then 'Closed
Workbooks.Open "C:\Users\gps943205\Desktop\OCVNM\DOSSIER FOLDERS\OCVNM-DC DOCUMENT CONTROL\OCVNM-DC 18 HEALTH\OCVNM-DC 18 C - MATERIAL SAFETY DATA SHEET\OCVNM CHEMICALS - MSDS.xls"
ElseIf Application.ActiveWorkbook.Name = WbookCheck.Name Then
WbookCheck.Close SaveChanges:=True
Else
WbookCheck.Activate
WbookCheck.Visible = True
End If
ActiveWindow.WindowState = xlMaximized