Unable to run macro in Excel 2007

M

Mahesh

Hi,
I have one macro which runs in Excel 2003 but dosent run in Office 2007.
This macro also runs in compatibility mode excel but dosent work in 2007
macro enable excel. Please find below is the code. Is there any reference
which we need to setup.

This macro is to get the data from database.

Please find below is the code and where I am getting the error. Error I am
getting is "Runtime error 424, Object required". Please help me in this.

Sub Get()
Dim i1 As Integer
Dim str1 As String
i1 = 2
While [querylist].Cells(i1, 1) <> "" --This is the place where I am
getting error in Excel 2007
CreateQuery (i1)
i1 = i1 + 1
Wend

Worksheets("Sheet1").Select
ActiveWorkbook.Save
End Sub

Thanks,
Mahesh

Reposting this in Excel Programming section
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top