Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Runtime Error 1004

hi!!

i keep getting this error in vb!!!

worksheetCount = objExcel.Worksheets.Count=== this is my code...

the error i get is Run Time error 1004--- Application Defined Error
or Object Error


Can somebody plz help me out in tis???

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Runtime Error 1004

How is objExcel setup/defined?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
hi!!

i keep getting this error in vb!!!

worksheetCount = objExcel.Worksheets.Count=== this is my code...

the error i get is Run Time error 1004--- Application Defined Error
or Object Error


Can somebody plz help me out in tis???



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Runtime Error 1004

On Apr 13, 12:35 pm, wrote:
hi!!

i keep getting this error in vb!!!

worksheetCount = objExcel.Worksheets.Count=== this is my code...

the error i get is Run Time error 1004--- Application Defined Error
or Object Error

Can somebody plz help me out in tis???


this is how i hav defined it!!

Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
worksheetCount = objExcel.Worksheets.Count


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Runtime Error 1004

Hi Honey,

'---------------
Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
worksheetCount = objExcel.Worksheets.Count
'---------------

Your problem resides in the fact that you have not
created or opened a workbook.

Information cannot be returned on the number of
worksheets in a non-existant workbook.


---
Regards,
Norman


wrote in message
oups.com...
On Apr 13, 12:35 pm, wrote:
hi!!

i keep getting this error in vb!!!

worksheetCount = objExcel.Worksheets.Count=== this is my code...

the error i get is Run Time error 1004--- Application Defined Error
or Object Error

Can somebody plz help me out in tis???


this is how i hav defined it!!

Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
worksheetCount = objExcel.Worksheets.Count




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Runtime Error 1004

On Apr 13, 1:51 pm, wrote:
On Apr 13, 12:35 pm, wrote:

hi!!


i keep getting this error in vb!!!


worksheetCount = objExcel.Worksheets.Count=== this is my code...


the error i get is Run Time error 1004--- Application Defined Error
or Object Error


Can somebody plz help me out in tis???


this is how i hav defined it!!

Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
worksheetCount = objExcel.Worksheets.Count




hey Hi!!

I have declared an excel path from the vb script!!

excelPath = "C:\ExcelFiles\Dimension XML Generation.xls"

Wen i run the macro from the excel sheet i get this error!!

Request you to kindly let me know if there is another way of defining
it



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Runtime Error 1004

On Apr 13, 1:51 pm, wrote:
On Apr 13, 12:35 pm, wrote:

hi!!


i keep getting this error in vb!!!


worksheetCount = objExcel.Worksheets.Count=== this is my code...


the error i get is Run Time error 1004--- Application Defined Error
or Object Error


Can somebody plz help me out in tis???


this is how i hav defined it!!

Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
worksheetCount = objExcel.Worksheets.Count




Is there any way by which I can set the excel path to the object???

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Runtime Error 1004

It is not the object, but the workbook. Worksheets belongs to a workbook,
but as you haven't opened one, there is no worksheets collection available.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ups.com...
On Apr 13, 1:51 pm, wrote:
On Apr 13, 12:35 pm, wrote:

hi!!


i keep getting this error in vb!!!


worksheetCount = objExcel.Worksheets.Count=== this is my code...


the error i get is Run Time error 1004--- Application Defined Error
or Object Error


Can somebody plz help me out in tis???


this is how i hav defined it!!

Dim objExcel As Object
Set objExcel = CreateObject("Excel.Application")
worksheetCount = objExcel.Worksheets.Count




Is there any way by which I can set the excel path to the object???



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime Error 1004 JB Bates[_2_] Excel Discussion (Misc queries) 5 December 29th 09 02:40 PM
Runtime error 1004 gyros Excel Programming 0 March 29th 06 09:03 PM
runtime error 1004 JC[_10_] Excel Programming 3 November 4th 05 12:50 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
What is RunTime Error '1004'? Ed Excel Programming 3 November 18th 04 07:09 PM


All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"