Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why error if available methods are used.
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
Though a lot of code is available for working with excel still want to clear a confusion as follows:

Code:
Set obj=Createobject("Excel.application")
obj.visible=True

Now when i use the following code:
obj.worksheets.add or
obj.worksheets(1).add

It shows "Unknown runtime error"

Not able to understand why is it so.Can anybody clarify this?
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
Set obj=Createobject("Excel.application")
After this statement, check
Code:
If obj = nothing then
    read error!
end if
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Please correct your code
Code:
Set obj=Createobject("Excel.application")
obj.visible=True
Obj.WorkBooks.add

Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Thanks for your reply.
Actually the confusion i had was why it showed error on placing worksheets in place of workbooks in the above code.
But now i have found that it shows error as it does not know in which workbook it should add the worksheet.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there any Inbuilt Methods to control the IE Browser. ritesh 2 2,207 04-26-2010, 05:11 PM
Last Post: ritesh
Question Methods for Applications bfakruddin 3 2,963 01-06-2009, 01:58 PM
Last Post: bfakruddin

Forum Jump:


Users browsing this thread: 1 Guest(s)