Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook code works on my machine but noy others
Hi,
I've got a Workbook i distribute to users. For some reason the WB is crashing only with some of my users. I get the error "Object Library Invalid or contains references to object definitions thatcould not be found" I've checked the reference ticked in VBE which a Visual Basic for Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Windows Common Controls-2 6.0 (SP6) Microsoft Outlook 10.0 Object Library Microsoft Windows Common Controls 6.0 (SP6) Weird as the application works ok on some machines but not other Any ideas on this are very welcome. Thanks guys, John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook code works on my machine but noy others
All user machines need to have the same version of references..In one of the
machines which return the error check VBEToolsReferences to see which one is missing in that machine.. If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi, I've got a Workbook i distribute to users. For some reason the WB is crashing only with some of my users. I get the error "Object Library Invalid or contains references to object definitions thatcould not be found" I've checked the reference ticked in VBE which a Visual Basic for Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Windows Common Controls-2 6.0 (SP6) Microsoft Outlook 10.0 Object Library Microsoft Windows Common Controls 6.0 (SP6) Weird as the application works ok on some machines but not other Any ideas on this are very welcome. Thanks guys, John |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook code works on my machine but noy others
Sometimes excel doesn't recognize the reference libraries and you had to
browse for the librarry file even though it appears to be correct. This happens often with the Ref Edit Control in particular but can happen with other libraries. "Jacob Skaria" wrote: All user machines need to have the same version of references..In one of the machines which return the error check VBEToolsReferences to see which one is missing in that machine.. If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi, I've got a Workbook i distribute to users. For some reason the WB is crashing only with some of my users. I get the error "Object Library Invalid or contains references to object definitions thatcould not be found" I've checked the reference ticked in VBE which a Visual Basic for Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Windows Common Controls-2 6.0 (SP6) Microsoft Outlook 10.0 Object Library Microsoft Windows Common Controls 6.0 (SP6) Weird as the application works ok on some machines but not other Any ideas on this are very welcome. Thanks guys, John |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook code works on my machine but noy others
Hi Jacob,
intersting comment!! I did notice that one of the references was version 3 on mine and version 2 on the users. Guess from what you're saying this can make a difference. So a follow up question is, would i need to uncheck it and then add it again? Thanks Regards, John "Jacob Skaria" wrote: All user machines need to have the same version of references..In one of the machines which return the error check VBEToolsReferences to see which one is missing in that machine.. If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi, I've got a Workbook i distribute to users. For some reason the WB is crashing only with some of my users. I get the error "Object Library Invalid or contains references to object definitions thatcould not be found" I've checked the reference ticked in VBE which a Visual Basic for Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Windows Common Controls-2 6.0 (SP6) Microsoft Outlook 10.0 Object Library Microsoft Windows Common Controls 6.0 (SP6) Weird as the application works ok on some machines but not other Any ideas on this are very welcome. Thanks guys, John |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook code works on my machine but noy others
Just try browsing the control again if it is available in that machine...
If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi Jacob, intersting comment!! I did notice that one of the references was version 3 on mine and version 2 on the users. Guess from what you're saying this can make a difference. So a follow up question is, would i need to uncheck it and then add it again? Thanks Regards, John "Jacob Skaria" wrote: All user machines need to have the same version of references..In one of the machines which return the error check VBEToolsReferences to see which one is missing in that machine.. If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi, I've got a Workbook i distribute to users. For some reason the WB is crashing only with some of my users. I get the error "Object Library Invalid or contains references to object definitions thatcould not be found" I've checked the reference ticked in VBE which a Visual Basic for Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Windows Common Controls-2 6.0 (SP6) Microsoft Outlook 10.0 Object Library Microsoft Windows Common Controls 6.0 (SP6) Weird as the application works ok on some machines but not other Any ideas on this are very welcome. Thanks guys, John |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook code works on my machine but noy others
Hi John,
Jacob's suggestion is far the easiest way to solve your issue but will only work when each user has his own version of the file. IMHO you will still have the problem when you share the same workook. You can of course upgrade each system to the same (highest) version but even this does not gurantee that it stays working over a longer period of time. (One has installed an higher version, the other not and the problem reoccurs. An alternative is to rewrite the code without including references. The code below creates a meeting request in Outlook. As I don't have the Outlook reference in the project, I had to define each constant. My approach: - Include the reference - Write and test the code - Lookup the values of the used constants in the object browser (View Menu) - Remove the reference - Declare the needed constants and adapt your code to late binding. In this example, gobjOutlook is defined as object an not as outlook.application. Wkr, JP Sub MultipleAppointment(Addressee, AddresseeOptional, OnDate, StartTime, EndTime, Subject, PrivateAPP, Location, BusyState, _ Recurrent, Interval, EndBy) Const olPRIVATE As Long = 2 ''' Outlook constant Const olRequired As Long = 1 Const olOptional As Long = 2 Const olRecursWeekly As Long = 1 Dim blnJP As Boolean, blnBusyState As Boolean Dim gobjOptionalAttendees As Object Dim strOptionalAddressee As String Dim olRecurrencePattern As Object Set gobjOutlook = GetObject(, "Outlook.application") Set gobjAppointment = gobjOutlook.CreateItem(olAppointmentItem) With gobjAppointment .MeetingStatus = olMeeting .Start = OnDate + TimeValue(StartTime) If (OnDate + TimeValue(EndTime)) <= .Start Then .End = OnDate + 1 + TimeValue(EndTime) Else .End = OnDate + TimeValue(EndTime) End If If Recurrent = True Then Set olRecurrencePattern = .GetRecurrencePattern olRecurrencePattern.RecurrenceType = olRecursWeekly olRecurrencePattern.Interval = Interval olRecurrencePattern.PatternStartDate = OnDate olRecurrencePattern.PatternEndDate = CDate(EndBy) "John" wrote in message ... Hi Jacob, intersting comment!! I did notice that one of the references was version 3 on mine and version 2 on the users. Guess from what you're saying this can make a difference. So a follow up question is, would i need to uncheck it and then add it again? Thanks Regards, John "Jacob Skaria" wrote: All user machines need to have the same version of references..In one of the machines which return the error check VBEToolsReferences to see which one is missing in that machine.. If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi, I've got a Workbook i distribute to users. For some reason the WB is crashing only with some of my users. I get the error "Object Library Invalid or contains references to object definitions thatcould not be found" I've checked the reference ticked in VBE which a Visual Basic for Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Windows Common Controls-2 6.0 (SP6) Microsoft Outlook 10.0 Object Library Microsoft Windows Common Controls 6.0 (SP6) Weird as the application works ok on some machines but not other Any ideas on this are very welcome. Thanks guys, John |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook code works on my machine but noy others
Look he
http://www.cpearson.com/excel/References.htm If you see anything that says 'MISSING' uncheck it and check the correct version. if you don't know what you have, run this code: Sub ReturnExcelVersion() If Application.Version = "12.0" Then MsgBox "You are using Excel 2007." ElseIf Application.Version = "11.0" Then MsgBox "You are using Excel 2003." ElseIf Application.Version = "10.0" Then MsgBox "You are using Excel 2002." ElseIf Application.Version = "9.0" Then MsgBox "You are using Excel 2000." ElseIf Application.Version = "8.0" Then MsgBox "You are using Excel 97." ElseIf Application.Version = "7.0" Then MsgBox "You are using Excel 95." End If End Sub Just saw it posted yesterday; very nice. You may want to consider using late binding, as described he http://www.dicks-clicks.com/excel/olBinding.htm HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "JP Ronse" wrote: Hi John, Jacob's suggestion is far the easiest way to solve your issue but will only work when each user has his own version of the file. IMHO you will still have the problem when you share the same workook. You can of course upgrade each system to the same (highest) version but even this does not gurantee that it stays working over a longer period of time. (One has installed an higher version, the other not and the problem reoccurs. An alternative is to rewrite the code without including references. The code below creates a meeting request in Outlook. As I don't have the Outlook reference in the project, I had to define each constant. My approach: - Include the reference - Write and test the code - Lookup the values of the used constants in the object browser (View Menu) - Remove the reference - Declare the needed constants and adapt your code to late binding. In this example, gobjOutlook is defined as object an not as outlook.application. Wkr, JP Sub MultipleAppointment(Addressee, AddresseeOptional, OnDate, StartTime, EndTime, Subject, PrivateAPP, Location, BusyState, _ Recurrent, Interval, EndBy) Const olPRIVATE As Long = 2 ''' Outlook constant Const olRequired As Long = 1 Const olOptional As Long = 2 Const olRecursWeekly As Long = 1 Dim blnJP As Boolean, blnBusyState As Boolean Dim gobjOptionalAttendees As Object Dim strOptionalAddressee As String Dim olRecurrencePattern As Object Set gobjOutlook = GetObject(, "Outlook.application") Set gobjAppointment = gobjOutlook.CreateItem(olAppointmentItem) With gobjAppointment .MeetingStatus = olMeeting .Start = OnDate + TimeValue(StartTime) If (OnDate + TimeValue(EndTime)) <= .Start Then .End = OnDate + 1 + TimeValue(EndTime) Else .End = OnDate + TimeValue(EndTime) End If If Recurrent = True Then Set olRecurrencePattern = .GetRecurrencePattern olRecurrencePattern.RecurrenceType = olRecursWeekly olRecurrencePattern.Interval = Interval olRecurrencePattern.PatternStartDate = OnDate olRecurrencePattern.PatternEndDate = CDate(EndBy) "John" wrote in message ... Hi Jacob, intersting comment!! I did notice that one of the references was version 3 on mine and version 2 on the users. Guess from what you're saying this can make a difference. So a follow up question is, would i need to uncheck it and then add it again? Thanks Regards, John "Jacob Skaria" wrote: All user machines need to have the same version of references..In one of the machines which return the error check VBEToolsReferences to see which one is missing in that machine.. If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi, I've got a Workbook i distribute to users. For some reason the WB is crashing only with some of my users. I get the error "Object Library Invalid or contains references to object definitions thatcould not be found" I've checked the reference ticked in VBE which a Visual Basic for Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Windows Common Controls-2 6.0 (SP6) Microsoft Outlook 10.0 Object Library Microsoft Windows Common Controls 6.0 (SP6) Weird as the application works ok on some machines but not other Any ideas on this are very welcome. Thanks guys, John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SQL.Request works on one machine but not another | Excel Worksheet Functions | |||
Distribute Add-In as Machine Code Only? | Excel Programming | |||
Reference & update destin. cells on 1st machine from source workbook on 2nd machine. | Excel Discussion (Misc queries) | |||
Excel Addin works that works on a template workbook | Excel Programming | |||
VS.NET 2003 .DLL used in Excel - works on my machine, no one else's | Excel Programming |