Article ID: 132753
Article Last Modified on 8/16/2005
Sub BinderExample()
Dim myBinder as Object, y as String
' Create Binder object
Set myBinder = CreateObject("Office.Binder")
' Add Microsoft Excel worksheet section
myBinder.sections.Add Type:="excel.sheet.5"
y = myBinder.sections(1).Object.Name
y = myBinder.sections(1).Object.Name
End Sub
When you run the macro above, the myBinder.sections.Add statement correctly
adds a worksheet section to the Binder. However, there is no pointer in
memory for this object. The first reference to this section object occurs
without an error, but the second reference to this object causes Microsoft
Excel to crash.
myBinder.sections(1).Visible = False
myBinder.sections(1).Visible = True
myBinder.Sections(1).Object.Parent.Worksheets.Add
myBinder.Sections(1).Object.Parent.Worksheets(1).Range("A1").Value = "1"
Sub BinderExample()
Dim myBinder as Object, XLSec as Object, y as String
' Create Binder object
Set myBinder = CreateObject("Office.Binder")
' Add Microsoft Excel worksheet section
Set XLSec = myBinder.sections.Add(Type:="excel.sheet.5")
y = myBinder.sections(1).Object.Name
y = myBinder.sections(1).Visible = True
End Sub
Microsoft provides examples of Visual Basic procedures for illustration
only, without warranty either expressed or implied, including but not
limited to the implied warranties of merchantability and/or fitness for a
particular purpose. This Visual Basic procedure is provided 'as is' and
Microsoft does not guarantee that it can be used in all situations.
Microsoft does not support modifications of this procedure to suit customer
requirements for a particular purpose.
CreateObject function
Additional query words: xl7 gpf crash
Keywords: KB132753