Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default method Worksheets of object _Global failed

Hi,

I'm seeing this run-time error in VB when I use the following code:

Dim ws As Worksheet
For Each ws In Worksheets ' this line throws the run-time
error
:


I tried using these statements at the beginning of the function
ActiveCell.Activate and/or DoEvents or putting a delay, but that didn't
help.
I also tried using Excel.Application.Worksheets and other ways to use
worksheets,
but nothing works!

The above code is in a VB DLL, which is compiled and installed
correctly.

This problem happens only when I try to debug my application using
visual studio C++.
The problem does not happen if I run the application stand-alone or
debug it with VB.

Any help is appreciated.

Thanks,
- ND

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default method Worksheets of object _Global failed

Can someone please help with this problem?

More info is that when I put "Application" in VB watch window, I see
various objects like:
Worksheets : <Application-defined or object-defined error

This happens ONLY when I debug my application using visual studio 6
C++. If I dont use C++ as debugging tool, then "Application" looks
fine...I'm really stucked !!

Thanks in advance.

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
Method 'Range' of object '_global' failed higherlimits Excel Discussion (Misc queries) 3 June 23rd 06 06:16 PM
Method Range of object '_Global' failed maverick2005 Excel Programming 3 August 25th 05 02:56 PM
What does XLS VB Method 'Range of object' _Global failed mean? DCMKGG Excel Programming 2 February 25th 05 03:06 PM
Method 'Range' of object '_Global' failed Mohanasundaram[_2_] Excel Programming 1 August 25th 03 01:43 PM


All times are GMT +1. The time now is 02:43 PM.

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"