Home |
Search |
Today's Posts |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks for the assistance!
"Peter T" wrote: If I merely change the reference to Outlook10 here at work...will it still work with BOTH systems? You said you have Outlook11 at work so you won't be able to do that. So leave your work ref as-is. At home change the ref to Outlook10, assuming you have Outlook10 on that system. If your code uses some method that was introduced in the later version it will fail in the earlier version, irrespective of the reference. Though I'm not aware of much difference between 10 & 11 so there's a good chance all will work, with the correct version references. While developing leave the references in place, though you'll need to re-check your home wb after moving it from work. When done you will probably find it easier to convert from Early to Late binding along the lines I briefly outlined. You can find much more about this topic in the ng Regards, Peter T "Tom" wrote in message ... Peter, Yes, I am using Outlook in parts of my code to auto-email certain sheets to a list of people. If I merely change the reference to Outlook10 here at work...will it still work with BOTH systems? As far as your other suggestions...I'll have to look up how to do those...ie changing any Outlook object variables so the are declared 'As Object' and changing any named Outlook constants to their intrinsic values. Thanks for the suggestions...I'll have a go with these and hopefully these solve the problems! Regards "Peter T" wrote: Does your code use the Outlook object model, IOW are you doing something with Outlook, if not remove the reference completely.That should solve the problem. If you are working with Outlook, in your home system with OfficeXP (which I assume includes Outlook) you should be able to change the reference to Outlook10. Problem will revert when you transport your Outlook11 ref to your home machine. Once your code is all working fine, change from "Early Binding" to "Late Binding". Briefly, that means unticking the Outlook ref, changing any Outlook object variables so the are declared 'As Object' and changing any named Outlook constants to their intrinsic values. Head your modules with 'Option Explicit' and do Debug - Compile project. Regards, Peter T "Tom" wrote in message ... Peter, I actually have Outlook 2003 SP2 here at work....and am using Outlook Express at home. Also, using XP Pro at work and XP Home Edition at home. Could this be the issue as you mentioned the different versions of outlook may be the issue? What options are available to correct this if this in fact is the issue? Regards "Peter T" wrote: It really does sound like a reference problem. You say you are using Excel 2002 SP3 on both machines, and you have this reference - Microsoft Outlook 11.0 Object Library Do you also have Outlook 2003 installed on both machines, if not that's where the problem is. If you have Outlook 2002 on the machine with the failing vba I'd be very surprised the reference is not marked as MISSING, reinforced by the fact your code fails on a string function, LCase. You will be able to transport the wb saved in the system with the earlier version of Outlook to that with the later, but not the other way round without correcting the reference. I also wonder if you have two versions of Office installed on one of the machines. Although you can run multiple versions of Excel, and most other Office apps, you can only have one version of Outlook installed. Regards, Peter T Microsoft Outlook 11.0 Object Library "Tom" wrote in message ... Nigel, These are what I have both at home and at work as far as references go: Visual Basic For Applications Microsoft Excel 10.0 Object Library OLE Automation Microsoft Office 10.0 Object Library Microsoft Outlook 11.0 Object Library Microsoft Forms 2.0 Object Library As I said, that was the FIRST thing that I looked at. Arlette...there are no other files associated with this spreadsheet and it does not reference any other files/drives/paths etc. As far as all the errors go...Upon opening up the workbook I started getting errors. First one was on a custom function that I am using. error: FUNCTION NOT DEFINED After disabling that macro...several other errors came up that I didn't write down the exact error names...frustration had set in at that point! I DO recall that the second macro that had an error was as follows: Private Sub Worksheet_Change(ByVal Target As Range) Dim sh As Worksheet, sh1 As Worksheet Dim rng As Range, Cell As Range Dim bVisible As Boolean Set rng = Worksheets("Main").Range("C8:C17") If Not Intersect(Target, rng) Is Nothing Then For Each sh1 In Worksheets bVisible = False If LCase(sh1.Name) < "main" Then <----ERROR OCCURED HERE For Each Cell In rng Set sh = Nothing On Error Resume Next Set sh = Worksheets(Cell.Value) On Error GoTo 0 If Not sh Is Nothing Then If sh.Name = sh1.Name Then bVisible = True Exit For End If End If Next Cell If bVisible Then sh1.Visible = xlSheetVisible Else sh1.Visible = xlSheetHidden End If End If Next sh1 End If End Sub After getting past this one....there was just error after error after error............... Thanks for taking the time to consider my issue here! "Nigel" wrote: These normally arise when different version of Excel are involved. But as you say you are suing the same version in both places! Are there any VB project references missing? Goto the VB editor 'Tools' - 'References' and see if there are any missing. If that is OK, you say "riddled with vb errors"; what type of errors are you getting? -- Regards, Nigel "Tom" wrote in message ... I have been slowly developing this spreadsheet for quite some time now and have been given a dealine now for completion. I decided to take it home to work on it...I open it up and it seems that the majority of the macros won't run on it at home! Why is it that a spreadsheet that I have at work has no issues at all with it running the macros while at home it is riddled with vb errors? - Both versions of Excel are the same...2002 SP3 - I ENSURED that the same libraries are installed on my version at home. Where else can I look to find what the issue may be? Upon completion of this spreadsheet, it will be distributed across the country...I am now extremely worried that it won't run properly on all those other computers!!! Any suggestions/ideas that may save me some gray hairs??? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Compatibility Issue | Excel Discussion (Misc queries) | |||
Compatibility Issue | Excel Discussion (Misc queries) | |||
could the #NAME? error be a compatibility issue? | New Users to Excel | |||
Quick XmlImport Compatibility issue | Excel Programming | |||
Code compatibility issue | Excel Programming |