Sub UserForm()
Dim i As Integer
'Typical approach for zero based collection is to use For i = 0 To [collection].Count-1
'If there is only 1 form open that counter will become For i = 0 to 0 (because of 1-1)
'This approach makes the counter from 1 to 1 when only 1 form is open
'and Userforms(i-1) produces the correct zero based starting point for the collection
'If count = 0 then no form is open, skip to With block, else test if open form name is QUIKview.
'If true, close it and exit sub
For i = 1 To VBA.UserForms.Count
If VBA.UserForms(i - 1).Name = "QUIKview" Then Unload VBA.UserForms(i - 1)
Exit Sub
Next
With QUIKview
.StartUpPosition = 0
.Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
.Top = Application.Top + (0.5 * Application.Height) - (0.3 * .Height)
.show
End With
End Sub