Al
Tue Jul 06 11:33:46 CDT 2004
Ok, I didn't make myself clear- I had not got to the part=20
of putting any other code in, therefore it went through=20
the code and shut itself straight down, no error.
On Excel addins it seems these do not load when you start=20
Excel with VBA- which is a bit of a "nuisance". I solved=20
the problem by making the addins required in Excel re-
install themselves on an autoOpen macro in the=20
spreadsheet, using code:
AddIns("Analysis Toolpak").Installed =3D False
AddIns("Analysis Toolpak - VBA").Installed =3D False
AddIns("Analysis Toolpak").Installed =3D True
AddIns("Analysis Toolpak - VBA").Installed =3D True
as I could not find a way to call them from Word. Seems an=20
awfully complicated way to get the functionality you=20
already had..lol Now my EDATE functions are correctly=20
calculated.
>-----Original Message-----
>Bonjour,
>
>Dans son message, < Al UK > =E9crivait :
>In this message, < Al UK > wrote:
>
>| If ExcelWasNotRunning Then
>| oXL.Quit
>| End If
>|
>| This part of the code was closing Excel straight back
>| down again- removing it seems to have cured the problem
>|
>
>The key word here is "seems"!
>
>The only way this code would execute is if there is an=20
error thrown when
>opening Excel. If you remove this code, you still get an=20
error when opening
>Excel.
>
>Debug again and carefully see where/how/why the code=20
below this line throws
>an error:
>'_______________________________________
>On Error GoTo Err_Handler
>'_______________________________________
>
>Also, you wrote that the code
>
>| If ExcelWasNotRunning Then
>| oXL.Quit
>| End If
>
>was being executed. If it was, how come you did not get=20
the message box that
>precedes?
>(In your original post you wrote:
>
><quote>
>already running. The code ran with no errors reporting,
>but nothing actually happened whenExcel was not running.
><endquote> )
>
>This means that no message box popped up, but if the=20
above code was
>executed, a message box had to pop up. See the original=20
code that you pasted
>directly from the MVP site:
>'_______________________________________
>Exit Sub
>
>Err_Handler:
> MsgBox WorkbookToWorkOn & " caused a problem. " &=20
Err.Description,
>vbCritical, _
> "Error: " & Err.Number
> If ExcelWasNotRunning Then
> oXL.Quit
> End If
>'_______________________________________
>
>See? Because of the Exit Sub statement, the only way the=20
Quit statement
>would run is if there was an error, in which case a=20
message box pops up. How
>come you never got that message box?
>
>--=20
>Salut!
>_______________________________________
>Jean-Guy Marcil - Word MVP
>jmarcilREMOVE@CAPSsympatico.caTHISTOO
>Word MVP site:
http://www.word.mvps.org
>
>
>
>.
>