Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default On error resume next

I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop and display
error message.

Any one have a solution?

Johan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default On error resume next

Your code cannot look like you posted... VB would tag the three lines
between the On Error statements as invalid syntax. Why don't you show us
what you are actually executing so we can see what you trying to do.

--
Rick (MVP - Excel)


"Johan" wrote in message
...
I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop and
display
error message.

Any one have a solution?

Johan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default On error resume next



Rick Rothstein skrev:

Your code cannot look like you posted... VB would tag the three lines
between the On Error statements as invalid syntax. Why don't you show us
what you are actually executing so we can see what you trying to do.

--
Rick (MVP - Excel)


"Johan" wrote in message
...
I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop and
display
error message.

Any one have a solution?

Johan


Sorry I did some error in my typing, the code is:

on error resume next
kill c:\arbeidsliste\sjekk.txt
kill c:\arbeidsliste\sjekk.bat
kill c:\arbeidsliste\send.bat
on error goto 0

Johan


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default On error resume next

You still have major syntax errors.

It's better to copy directly from the VBE and paste into your message.

That said, try this:

Inside the VBE
Tools|Options|General tab|check "break in class module"

(I'm guessing that you have break on all errors checked.)

Johan wrote:

Rick Rothstein skrev:

Your code cannot look like you posted... VB would tag the three lines
between the On Error statements as invalid syntax. Why don't you show us
what you are actually executing so we can see what you trying to do.

--
Rick (MVP - Excel)


"Johan" wrote in message
...
I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop and
display
error message.

Any one have a solution?

Johan


Sorry I did some error in my typing, the code is:

on error resume next
kill c:\arbeidsliste\sjekk.txt
kill c:\arbeidsliste\sjekk.bat
kill c:\arbeidsliste\send.bat
on error goto 0

Johan



--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default On error resume next

I have always used "Break on Unhandled Errors". I've not use very many Class
Modules in my coding across the years... does "Break in Class Module" work
the same way outside of the Class Module as "Break on Unhandled Errors" (the
Help file is not very clear on this point)?

--
Rick (MVP - Excel)


"Dave Peterson" wrote in message
...
You still have major syntax errors.

It's better to copy directly from the VBE and paste into your message.

That said, try this:

Inside the VBE
Tools|Options|General tab|check "break in class module"

(I'm guessing that you have break on all errors checked.)

Johan wrote:

Rick Rothstein skrev:

Your code cannot look like you posted... VB would tag the three lines
between the On Error statements as invalid syntax. Why don't you show
us
what you are actually executing so we can see what you trying to do.

--
Rick (MVP - Excel)


"Johan" wrote in message
...
I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop and
display
error message.

Any one have a solution?

Johan

Sorry I did some error in my typing, the code is:

on error resume next
kill c:\arbeidsliste\sjekk.txt
kill c:\arbeidsliste\sjekk.bat
kill c:\arbeidsliste\send.bat
on error goto 0

Johan



--

Dave Peterson




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default On error resume next

I saved this from a Chip Pearson post:

In general, it is better to use "Break In Class Module" rather than "Break
On Unhandled Errors". With break in class module, you'll enter debug mode on
the exact line within a class that caused the problem. With break on
unhandled errors, you'll break on the code that called the method of the
class, which is of little use for debugging. Of course, this is irrelevant
if you don't have code in any classes.



Rick Rothstein wrote:

I have always used "Break on Unhandled Errors". I've not use very many Class
Modules in my coding across the years... does "Break in Class Module" work
the same way outside of the Class Module as "Break on Unhandled Errors" (the
Help file is not very clear on this point)?

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
You still have major syntax errors.

It's better to copy directly from the VBE and paste into your message.

That said, try this:

Inside the VBE
Tools|Options|General tab|check "break in class module"

(I'm guessing that you have break on all errors checked.)

Johan wrote:

Rick Rothstein skrev:

Your code cannot look like you posted... VB would tag the three lines
between the On Error statements as invalid syntax. Why don't you show
us
what you are actually executing so we can see what you trying to do.

--
Rick (MVP - Excel)


"Johan" wrote in message
...
I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop and
display
error message.

Any one have a solution?

Johan

Sorry I did some error in my typing, the code is:

on error resume next
kill c:\arbeidsliste\sjekk.txt
kill c:\arbeidsliste\sjekk.bat
kill c:\arbeidsliste\send.bat
on error goto 0

Johan



--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default On error resume next

Okay, so it sounds like in non-Class Modules, they work the same... I'll
have to change my setting. Thanks.

--
Rick (MVP - Excel)


"Dave Peterson" wrote in message
...
I saved this from a Chip Pearson post:

In general, it is better to use "Break In Class Module" rather than "Break
On Unhandled Errors". With break in class module, you'll enter debug mode
on
the exact line within a class that caused the problem. With break on
unhandled errors, you'll break on the code that called the method of the
class, which is of little use for debugging. Of course, this is irrelevant
if you don't have code in any classes.



Rick Rothstein wrote:

I have always used "Break on Unhandled Errors". I've not use very many
Class
Modules in my coding across the years... does "Break in Class Module"
work
the same way outside of the Class Module as "Break on Unhandled Errors"
(the
Help file is not very clear on this point)?

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
You still have major syntax errors.

It's better to copy directly from the VBE and paste into your message.

That said, try this:

Inside the VBE
Tools|Options|General tab|check "break in class module"

(I'm guessing that you have break on all errors checked.)

Johan wrote:

Rick Rothstein skrev:

Your code cannot look like you posted... VB would tag the three
lines
between the On Error statements as invalid syntax. Why don't you
show
us
what you are actually executing so we can see what you trying to do.

--
Rick (MVP - Excel)


"Johan" wrote in message
...
I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop
and
display
error message.

Any one have a solution?

Johan

Sorry I did some error in my typing, the code is:

on error resume next
kill c:\arbeidsliste\sjekk.txt
kill c:\arbeidsliste\sjekk.bat
kill c:\arbeidsliste\send.bat
on error goto 0

Johan



--

Dave Peterson


--

Dave Peterson


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default On error resume next

I changed mine when I read Chip's message, too!

Rick Rothstein wrote:

Okay, so it sounds like in non-Class Modules, they work the same... I'll
have to change my setting. Thanks.

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
I saved this from a Chip Pearson post:

In general, it is better to use "Break In Class Module" rather than "Break
On Unhandled Errors". With break in class module, you'll enter debug mode
on
the exact line within a class that caused the problem. With break on
unhandled errors, you'll break on the code that called the method of the
class, which is of little use for debugging. Of course, this is irrelevant
if you don't have code in any classes.



Rick Rothstein wrote:

I have always used "Break on Unhandled Errors". I've not use very many
Class
Modules in my coding across the years... does "Break in Class Module"
work
the same way outside of the Class Module as "Break on Unhandled Errors"
(the
Help file is not very clear on this point)?

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
You still have major syntax errors.

It's better to copy directly from the VBE and paste into your message.

That said, try this:

Inside the VBE
Tools|Options|General tab|check "break in class module"

(I'm guessing that you have break on all errors checked.)

Johan wrote:

Rick Rothstein skrev:

Your code cannot look like you posted... VB would tag the three
lines
between the On Error statements as invalid syntax. Why don't you
show
us
what you are actually executing so we can see what you trying to do.

--
Rick (MVP - Excel)


"Johan" wrote in message
...
I have a macro which call other macroes.
In the end of the code it "cleans up" with the following code:

on error resume next
c:\arbeidsliste\sjekk.txt
c:\arbeidsliste\sjekk.bat
c:\arbeidsliste\send.bat
on error goto 0

The problem is that if one of the file is missing the code stop
and
display
error message.

Any one have a solution?

Johan

Sorry I did some error in my typing, the code is:

on error resume next
kill c:\arbeidsliste\sjekk.txt
kill c:\arbeidsliste\sjekk.bat
kill c:\arbeidsliste\send.bat
on error goto 0

Johan



--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default On error resume next

Okay, so it sounds like in non-Class Modules, they work the same... I'll
have to change my setting. Thanks.


Remember, too, that UserForms are considered class modules (as are the
Sheet moduels and ThisWorkbook), so if your userform's code has an
error and you don't have "Break In Class Module" enabled, the debugger
will take you to the line of code

UserForm1.Show

That is probably the hardest line of code in the world to screw up,
and so if you're not tuned into how the debugger works, you could
spend all day trying to figure out what's wrong with that line of code
(because nothing is wrong with it).

MS should change the wording in the Options screen to "Break In Object
Module".


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Tue, 25 Aug 2009 11:33:34 -0400, "Rick Rothstein"
wrote:

Okay, so it sounds like in non-Class Modules, they work the same... I'll
have to change my setting. Thanks.

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
on error resume next filo666 Excel Programming 7 January 26th 06 06:42 PM
On Error Resume Next ? Nigel Excel Programming 4 August 11th 05 09:07 AM
On Error Resume Next Nigel Excel Programming 3 August 10th 05 03:34 PM
On Error Resume Next Jasper Excel Programming 4 May 12th 05 12:08 PM
ON ERROR RESUME NEXT D.S.[_3_] Excel Programming 7 December 1st 03 09:40 AM


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