Microsoft KB Archive/172404: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 58: Line 58:


For a workaround, modify the Source argument for the OpenRecordset method from FILENAME#XLS to FILENAME$. Please see below for an illustration.
For a workaround, modify the Source argument for the OpenRecordset method from FILENAME#XLS to FILENAME$. Please see below for an illustration.
<pre class="codesample">  Set db = OpenDatabase(&quot;c:\file.xls&quot;, False, False, &quot;Excel 4.0;HDR=NO;&quot;)
<pre class="codesample">  Set db = OpenDatabase("c:\file.xls", False, False, "Excel 4.0;HDR=NO;")
   Set rs = db.OpenRecordset(&quot;file$&quot;)
   Set rs = db.OpenRecordset("file$")
                 </pre>
                 </pre>



Latest revision as of 11:06, 21 July 2020

Knowledge Base


Article ID: 172404

Article Last Modified on 2/21/2005



APPLIES TO

  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Enterprise Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic 5.0 Control Creation Edition



This article was previously published under Q172404

SYMPTOMS

Opening an entire Excel 4.0 Worksheet, according to the syntax described in Books Online and according to the syntax used in all previous versions of Visual Basic, will cause Run-time error '3011.'

RESOLUTION

For a workaround, modify the Source argument for the OpenRecordset method from FILENAME#XLS to FILENAME$. Please see below for an illustration.

   Set db = OpenDatabase("c:\file.xls", False, False, "Excel 4.0;HDR=NO;")
   Set rs = db.OpenRecordset("file$")
                

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

The syntax specified in Books Online for working with Excel Worksheets and Workbooks is consistent with the documentation for all previous versions of Visual Basic.

Other than opening entire Excel 4.0 Worksheets, no other problems are known to exist at this time. In fact, opening a named range in an Excel 4.0 Worksheet will work just as described.


Additional query words: kbVBp500 kbVBp kbWinOS98 kbDSupport kbdse kbDAO kbVBp600 kbExcel400

Keywords: kbprb KB172404