Re: Spreadsheet_Initialize event not firing

aaron_kempf_at_hotmail.com
Date: 11/29/04


Date: Mon, 29 Nov 2004 14:51:32 -0800

so uh-- if it is a KNOWN BUG WHY DOESN'T MICROSOFT FIX IT?

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:usoTlAvtEHA.3448@TK2MSFTNGP09.phx.gbl...
> That's a *known bug. It doesn't fire. You can use a substitute event like
> onload
>
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27***
> "Shawn Ferrier" <jeanchretien2@hotmail.com> wrote in message
> news:daf1bfeb.0410201203.5861890d@posting.google.com...
> > Good afternoon, all.
> >
> > First, thanks for all the great past posts. They've been a wealth of
> > information for me while trying to figure out how to use OWC for the
> > first time.
> >
> > That being the case, I've encountered one odd issue that I haven't
> > been able to find any reference to. Here is the situation. I have an
> > ASP page that has three Spread*** objects. The actual number is
> > dynamic, since it is based on how many CSV files are found, but let's
> > stick with three. All three objects have an identically defined
> > Spreadsheet_Initialize sub defined. The first of the three does not
> > execute when I load the page initially - I have to click Refresh in
> > order for it to fire. The other two workbooks have no problem.
> >
> > Here is the code in question:
> > ----------
> > <A NAME="Report2"></A><CENTER><H2>General User Information</H2>
> > <P><H3>This report is an output of primary user
> > information.</H3><P><OBJECT ID=Spreadsheet2
> > CLASSID=CLSID:0002E551-0000-0000-C000-000000000046
> > STYLE="WIDTH:49%;HEIGHT:359"></OBJECT></CENTER>
> > <SCRIPT LANGUAGE=VBScript>
> > Option Explicit
> >
> > Sub Spreadsheet2_Initialize()
> > Dim objProtection
> > Dim objUsedRange
> > Dim objWork***
> >
> > Spreadsheet2.CSVURL = "General User Information.txt"
> > Spreadsheet2.ActiveWorkbook.Worksheets("Sheet2").Delete
> > Spreadsheet2.ActiveWorkbook.Worksheets("Sheet3").Delete
> > For Each objWorksheet in Spreadsheet2.Worksheets
> > Set objUsedRange = objWork***.UsedRange
> > objUsedRange.Columns.AutoFit
> > objUsedRange.Locked = True
> > Set objProtection = objWork***.Protection
> > With objProtection
> > .Enabled = True
> > End With
> > Next
> >
> > Set objWork*** = Nothing
> > Set objUsedRange = Nothing
> > Set objProtection = Nothing
> > End Sub
> > </SCRIPT>
> > ----------
> >
> > Does anyone see anything terribly wrong with this? You may wonder
> > about things like why am I looping through worksheets when there is
> > clearly only one since I've deleted the other two. This piece of code
> > is created dynamically - in some cases, there are other worksheets.
> > There would be other code inserted that would be calling LoadText on
> > some other file.
> >
> > Much obliged,
> > Shawn
> > sferrier at gmail dot com
>
>


Loading