I think I have a comparable problem to "Howard Kaikow"
I'm using an "autoexec" macro to check & update a suite of
macros if a later version exists
Most of the code is OK, but I repeatedly find that a
couple of modules won't delete, and if I can't delete
them I can't copy the new version across

Simplified routine is (excuse any layout errors)
For all "macros & forms"
if new version > old version then
call DELMACRO(macroname)
end if
call addnewversion
Next "macro & forms"

Sub DelMacro(ThisMacro)
Application.OrganizerDelete _
Source:=NormalTemplate.fullname _
, Name:=ThisMacro _
, Object:=wdOrganizerObjectProjectItems
End Sub

Most of the time it works, but for two macros called "Get
WorkingDirectoryCode" & "GetPrinterModelCode" it won't
delete them, so they then won't add. I've tried a
different name (GWDC & GPMC) but that doesn't make any
difference

I've even tried capitalising the names just in case there
was a case (capital vv lower) issue involved like in some
library code, but that doesn't make any difference

I can always delete them using the VBA project window,
but can't see how that can be applied in normal VBA code
execution.

Once the program's crashed on the copy (can't copy over
existing file) they've gone from the project list, but
then it's a bit late.

Secondly, I've just moved up to Office 2K3 and find that
changes to the Autoexec macro don't always seen to be
saved when I exit Word.
When I restart work sometimes an earlier version of the
Autoexec macro runs and it's becoming rather frustrating
to troubleshoot the Macrodelete problem when you find the
latest code you're trying has disappeared

Any ideas on either issue??

Re: VBA code not deleting macros by Howard

Howard
Mon Sep 27 09:49:27 CDT 2004

The problem with toolbars is not related to any problem with code.

Looking at the pseudo-code below, I note that you are deleting "if new
version > old version" but there is no way to programmatically determine the
date/time a module was created (I sure wish there were a way).

In order to replace a module, you must first delete the old version.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Doug Barnes" <dougj.barnes@asph.nhs.uk> wrote in message
news:1ec701c4a49b$f028fa40$a501280a@phx.gbl...
> I think I have a comparable problem to "Howard Kaikow"
> I'm using an "autoexec" macro to check & update a suite of
> macros if a later version exists
> Most of the code is OK, but I repeatedly find that a
> couple of modules won't delete, and if I can't delete
> them I can't copy the new version across
>
> Simplified routine is (excuse any layout errors)
> For all "macros & forms"
> if new version > old version then
> call DELMACRO(macroname)
> end if
> call addnewversion
> Next "macro & forms"
>
> Sub DelMacro(ThisMacro)
> Application.OrganizerDelete _
> Source:=NormalTemplate.fullname _
> , Name:=ThisMacro _
> , Object:=wdOrganizerObjectProjectItems
> End Sub
>
> Most of the time it works, but for two macros called "Get
> WorkingDirectoryCode" & "GetPrinterModelCode" it won't
> delete them, so they then won't add. I've tried a
> different name (GWDC & GPMC) but that doesn't make any
> difference
>
> I've even tried capitalising the names just in case there
> was a case (capital vv lower) issue involved like in some
> library code, but that doesn't make any difference
>
> I can always delete them using the VBA project window,
> but can't see how that can be applied in normal VBA code
> execution.
>
> Once the program's crashed on the copy (can't copy over
> existing file) they've gone from the project list, but
> then it's a bit late.
>
> Secondly, I've just moved up to Office 2K3 and find that
> changes to the Autoexec macro don't always seen to be
> saved when I exit Word.
> When I restart work sometimes an earlier version of the
> Autoexec macro runs and it's becoming rather frustrating
> to troubleshoot the Macrodelete problem when you find the
> latest code you're trying has disappeared
>
> Any ideas on either issue??
>
>



Re: VBA code not deleting macros by Doug

Doug
Tue Sep 28 02:52:12 CDT 2004

I admit the code was VERY simplified, I actually track
the installed version in the registry and compare to a
tracking file on the server which holds the latest
versuion number.
I was comparing the fact that the "application.delete"
doesn't work as it should or is claimed to, in my case
for macros, in your case for toolbars
>-----Original Message-----
>The problem with toolbars is not related to any problem
with code.
>
>Looking at the pseudo-code below, I note that you are
deleting "if new
>version > old version" but there is no way to
programmatically determine the
>date/time a module was created (I sure wish there were a
way).
>
>In order to replace a module, you must first delete the
old version.
>
>--
>http://www.standards.com/; See Howard Kaikow's web site.
>"Doug Barnes" <dougj.barnes@asph.nhs.uk> wrote in message
>news:1ec701c4a49b$f028fa40$a501280a@phx.gbl...
>> I think I have a comparable problem to "Howard Kaikow"
>> I'm using an "autoexec" macro to check & update a suite
of
>> macros if a later version exists
>> Most of the code is OK, but I repeatedly find that a
>> couple of modules won't delete, and if I can't delete
>> them I can't copy the new version across
>>
>> Simplified routine is (excuse any layout errors)
>> For all "macros & forms"
>> if new version > old version then
>> call DELMACRO(macroname)
>> end if
>> call addnewversion
>> Next "macro & forms"
>>
>> Sub DelMacro(ThisMacro)
>> Application.OrganizerDelete _
>> Source:=NormalTemplate.fullname _
>> , Name:=ThisMacro _
>> , Object:=wdOrganizerObjectProjectItems
>> End Sub
>>
>> Most of the time it works, but for two macros
called "Get
>> WorkingDirectoryCode" & "GetPrinterModelCode" it won't
>> delete them, so they then won't add. I've tried a
>> different name (GWDC & GPMC) but that doesn't make any
>> difference
>>
>> I've even tried capitalising the names just in case
there
>> was a case (capital vv lower) issue involved like in
some
>> library code, but that doesn't make any difference
>>
>> I can always delete them using the VBA project window,
>> but can't see how that can be applied in normal VBA code
>> execution.
>>
>> Once the program's crashed on the copy (can't copy over
>> existing file) they've gone from the project list, but
>> then it's a bit late.
>>
>> Secondly, I've just moved up to Office 2K3 and find
that
>> changes to the Autoexec macro don't always seen to be
>> saved when I exit Word.
>> When I restart work sometimes an earlier version of the
>> Autoexec macro runs and it's becoming rather frustrating
>> to troubleshoot the Macrodelete problem when you find
the
>> latest code you're trying has disappeared
>>
>> Any ideas on either issue??
>>
>>
>
>
>.
>

Re: VBA code not deleting macros by Howard

Howard
Tue Sep 28 12:31:28 CDT 2004

There is no comparison between the deletion of toolbars and macros.
They are very different issues.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Doug BArnes" <anonymous@discussions.microsoft.com> wrote in message
news:286501c4a530$1073e320$a501280a@phx.gbl...
> I admit the code was VERY simplified, I actually track
> the installed version in the registry and compare to a
> tracking file on the server which holds the latest
> versuion number.
> I was comparing the fact that the "application.delete"
> doesn't work as it should or is claimed to, in my case
> for macros, in your case for toolbars
> >-----Original Message-----
> >The problem with toolbars is not related to any problem
> with code.
> >
> >Looking at the pseudo-code below, I note that you are
> deleting "if new
> >version > old version" but there is no way to
> programmatically determine the
> >date/time a module was created (I sure wish there were a
> way).
> >
> >In order to replace a module, you must first delete the
> old version.
> >
> >--
> >http://www.standards.com/; See Howard Kaikow's web site.
> >"Doug Barnes" <dougj.barnes@asph.nhs.uk> wrote in message
> >news:1ec701c4a49b$f028fa40$a501280a@phx.gbl...
> >> I think I have a comparable problem to "Howard Kaikow"
> >> I'm using an "autoexec" macro to check & update a suite
> of
> >> macros if a later version exists
> >> Most of the code is OK, but I repeatedly find that a
> >> couple of modules won't delete, and if I can't delete
> >> them I can't copy the new version across
> >>
> >> Simplified routine is (excuse any layout errors)
> >> For all "macros & forms"
> >> if new version > old version then
> >> call DELMACRO(macroname)
> >> end if
> >> call addnewversion
> >> Next "macro & forms"
> >>
> >> Sub DelMacro(ThisMacro)
> >> Application.OrganizerDelete _
> >> Source:=NormalTemplate.fullname _
> >> , Name:=ThisMacro _
> >> , Object:=wdOrganizerObjectProjectItems
> >> End Sub
> >>
> >> Most of the time it works, but for two macros
> called "Get
> >> WorkingDirectoryCode" & "GetPrinterModelCode" it won't
> >> delete them, so they then won't add. I've tried a
> >> different name (GWDC & GPMC) but that doesn't make any
> >> difference
> >>
> >> I've even tried capitalising the names just in case
> there
> >> was a case (capital vv lower) issue involved like in
> some
> >> library code, but that doesn't make any difference
> >>
> >> I can always delete them using the VBA project window,
> >> but can't see how that can be applied in normal VBA code
> >> execution.
> >>
> >> Once the program's crashed on the copy (can't copy over
> >> existing file) they've gone from the project list, but
> >> then it's a bit late.
> >>
> >> Secondly, I've just moved up to Office 2K3 and find
> that
> >> changes to the Autoexec macro don't always seen to be
> >> saved when I exit Word.
> >> When I restart work sometimes an earlier version of the
> >> Autoexec macro runs and it's becoming rather frustrating
> >> to troubleshoot the Macrodelete problem when you find
> the
> >> latest code you're trying has disappeared
> >>
> >> Any ideas on either issue??
> >>
> >>
> >
> >
> >.
> >