R
Robert L. Porter
I have a macro in an Excel workbook which is intended to
automatically update some information from a master
template. This update may require resizing named ranges.
Based upon a Sams book (I don't have the book with me at
the moment so I can't give the reference) on VBA 5, I use
the following code:
With Range("RangeName")
strNewRge = "=" & .Parent.Name & "!"
strNewRge = strNewRge & Cells(.Row, .Column).Address _
& ":"
strNewRge = strNewRge & Cells(.Row, ColCount).Address
Names("RangeName").RefersTo = strNewRge
End With
When the last line is executed (the line
containing "RefersTo"), I get an error message.
"Run-time error '-214741848 (80010108)':
Method 'RefersTo' of object 'Name' failed"
Looking at the value of "strNewRge" shows it to contain
the correct new range limits, properly formatted for range
definition.
A search in the Microsoft KnowledgeBase for this error
number brings up a post-sp2 hotfix which is supposed to
fix this error; however, applying this hotfix does NOT fix
the error, and it still persists.
Environment: Windows 2000 SP2 (5.00.2195)
Excel 2002 (10.4302.4210) SP-2
Visual Basic 6.3, Version 9108, VBA: Retail 6.3.8863
Any suggestions?
Bob Porter
automatically update some information from a master
template. This update may require resizing named ranges.
Based upon a Sams book (I don't have the book with me at
the moment so I can't give the reference) on VBA 5, I use
the following code:
With Range("RangeName")
strNewRge = "=" & .Parent.Name & "!"
strNewRge = strNewRge & Cells(.Row, .Column).Address _
& ":"
strNewRge = strNewRge & Cells(.Row, ColCount).Address
Names("RangeName").RefersTo = strNewRge
End With
When the last line is executed (the line
containing "RefersTo"), I get an error message.
"Run-time error '-214741848 (80010108)':
Method 'RefersTo' of object 'Name' failed"
Looking at the value of "strNewRge" shows it to contain
the correct new range limits, properly formatted for range
definition.
A search in the Microsoft KnowledgeBase for this error
number brings up a post-sp2 hotfix which is supposed to
fix this error; however, applying this hotfix does NOT fix
the error, and it still persists.
Environment: Windows 2000 SP2 (5.00.2195)
Excel 2002 (10.4302.4210) SP-2
Visual Basic 6.3, Version 9108, VBA: Retail 6.3.8863
Any suggestions?
Bob Porter