Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Further to my previous post on the 10th, i have a few
questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Are you stepping through (debugging) the code?
-- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I 've tried stepping throught the code or just letting it
run, the same thing happens in both cases... -----Original Message----- Are you stepping through (debugging) the code? -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tried the code at my end. I get error number 9 if the Reference doesn't
exist - as expected. I don't get anything about "Can't enter break mode". Suspecting some sort of corruption. Suggest you export the module, delete it, import it. or run Rob Bovey's code cleaner: http://www.appspro.com/Utilities/CodeCleaner.htm -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... I 've tried stepping throught the code or just letting it run, the same thing happens in both cases... -----Original Message----- Are you stepping through (debugging) the code? -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rob,
thanks for your help, but i doubt that the code is corrupted, it is a very simple 20 line procedure that works just fine if you dont programmatically add the reference, the problem seems to be in adding the reference through code, i had a look at http://support.microsoft.com/default...b;en-us;155051 but that doesn's solve the problem. The most amazing thing is that it keeps adding a reference to c:\windows\system32 and i'm asking it to add it to c:\ it doens't make much sense, anywayz, thanks for your help. Alex -----Original Message----- Tried the code at my end. I get error number 9 if the Reference doesn't exist - as expected. I don't get anything about "Can't enter break mode". Suspecting some sort of corruption. Suggest you export the module, delete it, import it. or run Rob Bovey's code cleaner: http://www.appspro.com/Utilities/CodeCleaner.htm -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... I 've tried stepping throught the code or just letting it run, the same thing happens in both cases... -----Original Message----- Are you stepping through (debugging) the code? -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex . . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thinking about what you just said, you might be right in
that before i tried to programmatically add the reference i added it manually so this may somehow confuse VBA. How do i permanently delete a reference so that it would not appear in the tools-references list at all. By physically deleting the file the list still displays the reference name, i.e. progressindicator, but when you click on it it says error in loading dll, unfortunately it doesn't prompt you to permanently delete ir thanks, Alex -----Original Message----- Tried the code at my end. I get error number 9 if the Reference doesn't exist - as expected. I don't get anything about "Can't enter break mode". Suspecting some sort of corruption. Suggest you export the module, delete it, import it. or run Rob Bovey's code cleaner: http://www.appspro.com/Utilities/CodeCleaner.htm -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... I 've tried stepping throught the code or just letting it run, the same thing happens in both cases... -----Original Message----- Are you stepping through (debugging) the code? -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex . . |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You know how to delete it via automation. The manual way is via Tools |
References. I don't know of any other way. -- Rob van Gelder - http://www.vangelder.co.nz/excel "alex" wrote in message ... Thinking about what you just said, you might be right in that before i tried to programmatically add the reference i added it manually so this may somehow confuse VBA. How do i permanently delete a reference so that it would not appear in the tools-references list at all. By physically deleting the file the list still displays the reference name, i.e. progressindicator, but when you click on it it says error in loading dll, unfortunately it doesn't prompt you to permanently delete ir thanks, Alex -----Original Message----- Tried the code at my end. I get error number 9 if the Reference doesn't exist - as expected. I don't get anything about "Can't enter break mode". Suspecting some sort of corruption. Suggest you export the module, delete it, import it. or run Rob Bovey's code cleaner: http://www.appspro.com/Utilities/CodeCleaner.htm -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... I 've tried stepping throught the code or just letting it run, the same thing happens in both cases... -----Original Message----- Are you stepping through (debugging) the code? -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex . . |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to delete it of the list so it does not appear there
at all! -----Original Message----- You know how to delete it via automation. The manual way is via Tools | References. I don't know of any other way. -- Rob van Gelder - http://www.vangelder.co.nz/excel "alex" wrote in message ... Thinking about what you just said, you might be right in that before i tried to programmatically add the reference i added it manually so this may somehow confuse VBA. How do i permanently delete a reference so that it would not appear in the tools-references list at all. By physically deleting the file the list still displays the reference name, i.e. progressindicator, but when you click on it it says error in loading dll, unfortunately it doesn't prompt you to permanently delete ir thanks, Alex -----Original Message----- Tried the code at my end. I get error number 9 if the Reference doesn't exist - as expected. I don't get anything about "Can't enter break mode". Suspecting some sort of corruption. Suggest you export the module, delete it, import it. or run Rob Bovey's code cleaner: http://www.appspro.com/Utilities/CodeCleaner.htm -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... I 've tried stepping throught the code or just letting it run, the same thing happens in both cases... -----Original Message----- Are you stepping through (debugging) the code? -- Rob van Gelder - http://www.vangelder.co.nz/excel "Alex" wrote in message ... Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 Application.DisplayAlerts = False ThisWorkbook.VBProject.References.AddFromFile ("c:\ProgressIndicator.dll") Application.DisplayAlerts = True So, in the first instance i delete the reference and then i add it up again. Please note that in the current procedure i do not use the dll, the dll is used from another procedure. So, there are two cases one in which the dll is already referenced and one in which it is not. Suppose that it is referenced, then the code in deleteing the reference comes up with "Can't enter break mode at this time" and the options "continue" or "end only" are possible. So i used debug.print err.number to get the error number, which is zero! If its not referenced then it goes smoothly through the "deletion" routine (as there is nothing to delete) and again comes up with "Can't enter break mode at this time" "continue" or "end" options. Now, here the strangest thing happens, i click on end and i have a look at the references, and the code has added a reference to "ProgressIndicator.dll" but not on "C:\" but rather on "C:\windows\System32\". I really don't get and of course the "ProgressIndicator.dll" does not reside on system32... I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex . . . |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you probably cant do it from within the compiled project itself
i suggest you to put your 'changing' code in another project, and call the function via an ontime keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Alex" wrote: Further to my previous post on the 10th, i have a few questions/results to post, i find it impossible to remove any reference without an error coming up. I used the following code: On Error Resume Next Application.DisplayAlerts = False With ThisWorkbook.VBProject.References .Remove .Item("ProgressIndicator") Debug.Print Err.Number End With Application.DisplayAlerts = True On Error GoTo 0 I am a bit perplexed, sorry for the big post, Thanks a lot for your replies, rgrds, Alex |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I remove a reference from a cell? | Excel Discussion (Misc queries) | |||
How to remove path from macro reference | Excel Discussion (Misc queries) | |||
remove rows with the same reference | Excel Programming | |||
remove reference via code | Excel Programming | |||
Remove a reference | Excel Programming |