Note that there are some explanatory texts on larger screens.

plurals
  1. POOLE Excel object manipulation causes run-time error '91'
    primarykey
    data
    text
    <p>I am maintaining an application that was written in Visual Basic 6.0 and makes use of the several OLE controls with <code>Excel.Sheet.8</code> class objects. Several users are getting the following error when they reach a point in code that attempts to manipulate the excel objects. </p> <blockquote> <p>Run-time error '91': Object variable or With block variable not set</p> </blockquote> <p>Below are examples of the code that trigger this error. I believe that the issue happens at: </p> <pre><code>Set oExcel = oleXl.object </code></pre> <p>Here are the points in the code where it happens:</p> <pre><code>Private Sub Form_Load() Dim i As Integer Dim j As Integer Dim sTempStringA As String Dim sTempStringB As String 'Set up excel sheet centerform Me Set oOutGrid = oleXlOutput.object ... Private Sub Form_Load() centerform Me Set oOtherFx = oleXlFx.object ... Private Sub Form_Load() Dim iRet As Integer Dim i As Integer On Error GoTo Err_Handler centerform Me Call InitArray Me.Caption = "TJUJ | Version " &amp; version &amp; " | Enter Custom Fx" Set oBook = oleExcel.object ... </code></pre> <p>Is there a specific situation or environment in which this error would be generated from this line of code OR a way that I can ensure the object will always be accessible at this point in the code? </p> <p>The error only happens occasionally, and I can't reproduce it on my developer machine at all. I also do not have access to the machines that it is happening on, but it seems to be encountered when there is an instance of the EXCEL.EXE process running.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload