VBA Error after installing Microsoft Accounting

B

Berlie

Before installing Microsoft Accounting 2007 the following VBA code in
Word 2007 under Vista worked fine. After installing it gives a Command
Not
Available error on the .LinkToPrevious = False line.

Sub UnLink()
Dim oSect As Section
Dim i As Long
For Each oSect In ActiveDocument.Range.Sections
For i = 1 To 3
oSect.Footers(i).LinkToPrevious = False
oSect.Headers(i).LinkToPrevious = False
Next
Next oSect
End Sub


Uninstall Accunting 2007 and it works fine again. Confirmed problem
with two
other people on different computers running Vista/Word 2007 and then
testing
VBA code before and after installing Acct 2007. The maco is meant to
unlink
all headers and footers in document from previous section.

Any ideas whats going wrong and why?
 
S

Shauna Kelly

Hi Berlie

I don't know what might be wrong, but if this were mine, I would replace
For Each oSect In ActiveDocument.Range.Sections
with
For Each oSect In ActiveDocument.Sections

In the (unlikely!) event that this fixes the problem, please let us know in
case other people have similar issues.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
B

Berlie

Thanks for your reply.

I tried the code change you suggested first without Accounting
installed and it worked fine.
I then reinstalled Accounting and got the Command Not Available error
again.
Debug showed the:
oSect.Headers(i).LinkToPrevious = False
line highlighted.

I have also tried various other means of unlinking headers and footers
in a macro and always get the error on the .LinkToPrevious = False
line when Accounting is installed.

Kim
 
B

Berlie

With further testing it seems to be related to the Paypal add-in that
installs with Accounting. If I only remove the Paypal add-in and not
the entire Accounting program it works fine again.

/shrug

Kim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top