Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 174
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL.Request works on one machine but not another IndyIT Excel Worksheet Functions 0 November 20th 07 10:16 PM
Distribute Add-In as Machine Code Only? Lazzaroni Excel Programming 1 October 17th 07 05:44 PM
Reference & update destin. cells on 1st machine from source workbook on 2nd machine. [email protected] Excel Discussion (Misc queries) 6 February 28th 06 05:15 AM
Excel Addin works that works on a template workbook s.jay_k Excel Programming 0 February 15th 06 07:31 PM
VS.NET 2003 .DLL used in Excel - works on my machine, no one else's Yacobs Excel Programming 3 November 17th 04 03:43 PM


All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"