Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I invoke the "Reset" button in the VB Editior via code?

Hi,
I am writing a macro in an MPP.The macro runs fine for the first
time.But
the next time its run its popping up an Error.But again after clicking
the
"Reset" button in the VB Editor the code works fine again.

Is there any way that I can "Reset" in the code itself?So that it will
work
fine the next time its run.


In Debug mode, Im getting "Run time Error 1004 Method Cells of object
'_Global' failed at the following line of code.
Cells.Find(what:=subtask_name, lookat:=xlWhole,
searchDirection:=xlNext).Activate



Thanks in advance,
Vinita
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I invoke the "Reset" button in the VB Editior via code?

ok....This would continue with the next statements of my code even after the
error occurs.But, it would not give me the required format of the excel I
need.

"Nigel" wrote:

It appears the search is failing. Try putting in line before the search
command e.g.

On Error Resume Next
Cells.Find(what:=subtask_name, lookat:=xlWhole,
searchDirection:=xlNext).Activate



--

Regards,
Nigel




"Vinita" wrote in message
...
Hi,
I am writing a macro in an MPP.The macro runs fine for the first
time.But
the next time its run its popping up an Error.But again after clicking
the
"Reset" button in the VB Editor the code works fine again.

Is there any way that I can "Reset" in the code itself?So that it will
work
fine the next time its run.


In Debug mode, Im getting "Run time Error 1004 Method Cells of object
'_Global' failed at the following line of code.
Cells.Find(what:=subtask_name, lookat:=xlWhole,
searchDirection:=xlNext).Activate



Thanks in advance,
Vinita


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default How do I invoke the "Reset" button in the VB Editior via code?

Hi,

Assign the result of the Find to an object and remove the Activate method.
If the item is not found the Activate will cause an error.

The help file has example code, select Find and press F1.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Vinita" wrote in message
...
Hi,
I am writing a macro in an MPP.The macro runs fine for the first
time.But
the next time its run its popping up an Error.But again after clicking
the
"Reset" button in the VB Editor the code works fine again.

Is there any way that I can "Reset" in the code itself?So that it will
work
fine the next time its run.


In Debug mode, Im getting "Run time Error 1004 Method Cells of object
'_Global' failed at the following line of code.
Cells.Find(what:=subtask_name, lookat:=xlWhole,
searchDirection:=xlNext).Activate



Thanks in advance,
Vinita


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I invoke the "Reset" button in the VB Editior via code?


Actually in my program I am porting MPP data into an excel in a format.
And I checked the execution line by line and I find that the excel is
created and also the data it is searching is present in the excel.But Im not
able to figure out why then it is failing while search.

Thanks,
Vinita
"Andy Pope" wrote:

Hi,

Assign the result of the Find to an object and remove the Activate method.
If the item is not found the Activate will cause an error.

The help file has example code, select Find and press F1.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Vinita" wrote in message
...
Hi,
I am writing a macro in an MPP.The macro runs fine for the first
time.But
the next time its run its popping up an Error.But again after clicking
the
"Reset" button in the VB Editor the code works fine again.

Is there any way that I can "Reset" in the code itself?So that it will
work
fine the next time its run.


In Debug mode, Im getting "Run time Error 1004 Method Cells of object
'_Global' failed at the following line of code.
Cells.Find(what:=subtask_name, lookat:=xlWhole,
searchDirection:=xlNext).Activate



Thanks in advance,
Vinita




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
How do I create a "Reset Data" Button for a Worksheet? Billy Excel Worksheet Functions 3 December 15th 08 09:29 PM
Range("Reset Sheet!F13").Select Makes VBA Code Fail ToferKing Excel Programming 3 July 11th 07 04:18 AM
VBA code to "reset" application run and empty preserved arrays [email protected] Excel Programming 2 May 9th 07 11:40 AM
using % button gives error "percent style not found" Can I reset? Light Excel Discussion (Misc queries) 3 March 16th 06 12:18 PM
pressing the "reset" button and freeing memory Elie W Excel Programming 1 February 12th 04 07:44 PM


All times are GMT +1. The time now is 07:28 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"