dbTalk Databases Forums  

ActiveX to turn off Excel Automatic Error Checking

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss ActiveX to turn off Excel Automatic Error Checking in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jason
 
Posts: n/a

Default ActiveX to turn off Excel Automatic Error Checking - 04-20-2004 , 06:34 PM






I am executing this from an ActiveX script within a DTS Package.
I am attemtpting to turn the Automatic Error Checking off.

Can I do this?

Here is my code
----------------------
Dim checkRange

For Each checkRange In xlsWorksheet.Range(Excel_Range)
If checkRange.Errors.Item(xlNumberAsText).Value = True Then
checkRange.Errors.Item(xlNumberAsText).value = False
End If
Next
----------------------

If I do it from the application level is that a permanent change or when
opened on a different machine will it go away. Right now, my speadsheets
are created on the fly. I am guessing that my best bet is to make a template
with an OnOpen Macro to turn off the error checking and an OnClose to turn it
back on. Any other suggestions?

Thanks for your time.

Cheers,

Jason

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: ActiveX to turn off Excel Automatic Error Checking - 04-21-2004 , 01:07 AM






Is using the Excel object model really something you want to do from within
DTS? It means that should you want to schedule the package then you will
need Excel on the server and for that MS will not support you (Office,
unattended, server side).

If the answer to the above is that you need to run the Excel code then yes I
would place it within a macro whch again raises a concern in that you do not
want Excel asking you "Do you want to allow Macros in this Spreadsheet"
otherwise the DTS package will hang.

Will your changes in the code below persist?

Although I have not checked it I would say that you would have to save the
Excel Spreadsheet back for that to happen.
--

----------------------------

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Jason" <jjrzut (AT) gene (DOT) com> wrote

Quote:
I am executing this from an ActiveX script within a DTS Package.
I am attemtpting to turn the Automatic Error Checking off.

Can I do this?

Here is my code
----------------------
Dim checkRange

For Each checkRange In xlsWorksheet.Range(Excel_Range)
If checkRange.Errors.Item(xlNumberAsText).Value = True Then
checkRange.Errors.Item(xlNumberAsText).value = False
End If
Next
----------------------

If I do it from the application level is that a permanent change or when
opened on a different machine will it go away. Right now, my speadsheets
are created on the fly. I am guessing that my best bet is to make a
template
with an OnOpen Macro to turn off the error checking and an OnClose to turn
it
back on. Any other suggestions?

Thanks for your time.

Cheers,

Jason



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.