MC-8
MC-8

Reputation: 65

how to display popup methods for Excel objects in VBA?

I am working with access 2010 and writing so VBA code. My problem is that when I write the object name and a dot, the method list for this kind of object does not appear. With other types of objects such as recordset is fine. I believe the problem is that I do not declare the objects, but just set them as follows:

Set ExcelFile = CreateObject("Excel.Application")
Set Wbook = ExcelFile.Workbooks.Add
Set Wsheet = Wbook.Worksheets.Add

and the following do not work

Dim ExcelFile As Microsoft.Office.Interop.Excel

or

Dim ExcelFile As Microsoft.Office.Interop.Excel.Application

or

 Dim ExcelFile As Object

and

 Dim Wsheet1 As Worksheet 

does not recognize Worksheet

The code works fine, is just that I would like to see the methods list while coding... Thanks!

Upvotes: 0

Views: 1029

Answers (1)

Fabio Pereira
Fabio Pereira

Reputation: 348

You have to add the Excel Object Library to the references in VBA. Tools -> References, and look for Microsoft Excel XX.X Object Library. Then the declarations (and IntelliSense) should work.

Upvotes: 1

Related Questions