10-18-2012, 04:50 PM
Hi,
I am getting the error mentioned in subject. No matter what is the first line of the code, it fails at that part only by giving this error. Following is the starting piece of code.
-----------------------
-----------------------
Following is the code where I am getting error: Object required: 'God'
-----------------------
I am opening an excel application in which I want to write some results, which is later part. I am not able to do this. Please help!!!
I am getting the error mentioned in subject. No matter what is the first line of the code, it fails at that part only by giving this error. Following is the starting piece of code.
-----------------------
Code:
Set ExcelApp = CreateObject("Excel.Application")
ExcelApp.Visible=true
Following is the code where I am getting error: Object required: 'God'
-----------------------
Code:
TheDate = Date( )
msgbox TheDate
GetDay = DatePart("d", TheDate)
GetMonth = DatePart("m", TheDate)
GetYear = DatePart("yyyy", TheDate)
MyDate = GetMonth & "/" & GetDay & "/" & GetYear
msgbox MyDate
With ExcelWS.UsedRange
Set c = .Find (MyDate)
For each c in ExcelWS.UsedRange
If c = MyDate then
God = ExcelWS.UsedRange.Find(c)
msgbox God
End If
Set c = .FindNext(c)
Next
End With
FirstAddress= God.Address
SecondAddress = God.Column
msgbox FirstAddress
msgbox SecondAddress
I am opening an excel application in which I want to write some results, which is later part. I am not able to do this. Please help!!!