Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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??? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Are the macros on the same spreadsheet or in a different workbook?
What about the file names that are invoked in the macro - are they the same? You need to ensure that if you open certain files or save them in a particular folder - the folder structure / file names need to be the same... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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??? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You actually stated that you checked the same libraries were installed, I
was referring to checking that they have been referenced in the project. But it sounds like they have. You say there are no external references. How did you fix the UDF that failed? This might give a clue, as will the exact error codes. Can you confirm that if you re-open this workbook in your office environment it still works? What might be happening is that object references, names changing, cell contents may be creating conditions that cause your code to fail. -- Regards, Nigel "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??? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nigel,
I never actually fixed the code that failed at home last night. Time restraints kept me from actually spending any time on it last night - but I was hoping to be able to work on it this weekend which is why I brought the file home last night. I never corrected any errors, or attempted to since they seemed to be too numerous to tackle in the short time I had last night. Yes...I opened the workbook here at work this morning and it works just fine. I'll have time this weekend to go over each error in the workbook at home and see what I come up with. "Nigel" wrote: You actually stated that you checked the same libraries were installed, I was referring to checking that they have been referenced in the project. But it sounds like they have. You say there are no external references. How did you fix the UDF that failed? This might give a clue, as will the exact error codes. Can you confirm that if you re-open this workbook in your office environment it still works? What might be happening is that object references, names changing, cell contents may be creating conditions that cause your code to fail. -- Regards, Nigel "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??? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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??? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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??? |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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??? |
Reply |
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 |