LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Workbook_Open - AutoCorrect Routine Doesn't Work

I'm using Excel 2003 - SP3

I've written a couple of routines to Add and subsequently Delete a
couple of AutoCorrect entries. The intention was to call the Add
routine from Workbook_Open and the Del routine from
Workbook_BeforeClose.

Both routines work fine when fired from the VBE using F5. The Del
routine also works fine when called from the Workbook_BeforeClose
routine. However, the Add routine is impotent when called from either
the Workbook_Open or Auto_Open routines.

It runs without error, as evidenced by msg boxes but it has no effect
on the ACL. Here's the code for the Add routine - apologies for any
wrap-around...

Public Sub AutoCorrectAdd()
Dim repl() As Variant
Dim x As Long
Dim TLA_used As Boolean
Dim TLAO_used As Boolean

MsgBox "Start of AutoCorrectAdd. Error = " & Err.Number

TLA_used = False
TLAO_used = False

repl = Application.AutoCorrect.ReplacementList

For x = 1 To UBound(repl)
If repl(x, 1) = "TLA" Then TLA_used = True
If repl(x, 1) = "TLAO" Then TLAO_used = True
Next

If Not TLA_used Then _
Application.AutoCorrect.AddReplacement _
What:="TLA", _
Replacement:="Top Level Action Owner"
If Not TLAO_used Then _
Application.AutoCorrect.AddReplacement _
What:="TLAO", _
Replacement:="Top Level Action Owner"
' Yes I do want both TLA and TLAO to mean the same

MsgBox "End of AutoCorrectAdd. Error = " & Err.Number

End Sub

There are a small number of earlier posts regarding this issue and
responses all seem to imply the developer is doing something wrong but
don't manage to pinpoint what. I'm wondering if this could be a
version/update specific problem. Is it possible that Microsoft have
blocked ACL changes by opening routines, to prevent a specific hack?

I guess what I'm asking is - Am I fighting a lost battle or is there a
way round this?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
workbook_open() sub does not work eholz1 Excel Programming 2 January 23rd 08 08:05 PM
Update Links Stopping Workbook_Open Routine michael.beckinsale Excel Programming 0 August 20th 07 10:30 AM
Workbook_Open does not work Woodsman Excel Programming 1 August 15th 07 07:54 PM
Workbook_Open() does not work Ken Excel Programming 3 July 14th 06 06:51 PM
How do I transfer the autocorrect options from work to home? Flint Excel Discussion (Misc queries) 1 May 14th 06 07:59 PM


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"