![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]() 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! |
#2
|
|||
|
|||
![]()
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! |
#3
|
|||
|
|||
![]()
Thanks, this works:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Dim XLObject As Object Set XLObject = GetObject("H:\Outlook\Prosjekt.xls") XLObject.Close SaveChanges:=True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reminder from Excel Workbook | Looping through | Outlook and VBA | 1 | February 29th 08 05:03 PM |
Close Message, Close Outlook | cdf | Outlook - General Queries | 2 | April 16th 07 03:42 PM |
How can I eMail only the selection from Excel, not the workbook | Andre | Outlook - General Queries | 0 | February 20th 07 07:46 PM |
Build a userform on excel to copy contacts from outlook 2003 | Oggy | Outlook - General Queries | 4 | January 2nd 07 06:13 PM |
Build a userform on excel to copy contacts from outlook 2003 | Oggy | Outlook and VBA | 4 | January 2nd 07 06:13 PM |