LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 408
Default Runtime Error 91 Object variable or With block variable not set.

Using VBA 6.5, I receive the runtime error when running FormatQtrAnalysis.
I know it has to do something with the way I have set up the class
CSTIAnalysis.
Problem is I do not know what that something is.
Is there any suggestions as to what I am overlooking?
Any suggestions as to where to look at will be appreciated.
(Of course, an answer will Greatly Appreciated!)
From STIOptions Module


Sub FormatQtrAnalysis()
Dim csaQtrAnalysis As CSTIAnalysis
Set csaQtrAnalysis = New CSTIAnalysis
csaQtrAnalysis.Worksheet = ActiveSheet
csaQtrAnalysis.FormatHeader 'When pressing Debug, this line is
highlighted
End Sub

From CSTIAnalysis Class


Private pWorksheet As Worksheet

Public Property Get Worksheet() As Worksheet
Worksheet = pWorksheet
End Property
Public Property Let Worksheet(vNewValue As Worksheet)
Set pWorksheet = vNewValue
End Property

Public Sub FormatHeader()
Dim rHeader As Range
Dim iColCount As Integer
iColCount = pWorksheet.UsedRange.Columns.Count
rHeader = pWorksheet.Range(Cells(1, 1), Cells(1, iColCount))
rHeader.MergeCells = False
With rHeader
.Merge
.EntireRow.AutoFit
.BorderAround Weight:=xlThick, ColorIndex:=1
End With
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error '91' Object variable or With block variable not set Alec Coliver Excel Discussion (Misc queries) 2 October 24th 09 02:29 PM
Need help with Error 'object variable or with block variable not set' Francois via OfficeKB.com Excel Programming 5 April 30th 07 03:05 PM
Run-Time error '91': Object variable of With block variable not set jammin1911 Excel Programming 3 June 6th 06 06:36 PM
Run-time error '91': "Object variable or With block variable not set Mike[_92_] Excel Programming 2 December 30th 04 10:59 AM
Cells.Find error Object variable or With block variable not set Peter[_21_] Excel Programming 2 May 8th 04 02:15 PM


All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"