ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Unable to run macro in Office 2007 (https://www.excelbanter.com/excel-discussion-misc-queries/152638-unable-run-macro-office-2007-a.html)

Mahesh

Unable to run macro in Office 2007
 
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

Jim Rech

Unable to run macro in Office 2007
 
I'd try:

While Range("querylist").Cells(i1, 1).Value < ""

--
Jim
"Mahesh" wrote in message
...
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





All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com