You are trying to call the Close method on the Name property of the
workbook. Try getting the workbook as an object and calling its Close
method.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
wrote in message
...
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
Set objXL = GetObject(, "Excel.Application")
x = objXL.Workbooks.Application.ActiveWorkbook.Name
If x = "Prosjekt.xls" Then
objXL.x.Close savechanges:=True ' ?????????
End If
End Sub
Need help!