PC Review


Reply
 
 
lukecs
Guest
Posts: n/a
 
      29th Oct 2008
heres my sub

Sub testing2()
With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With
Range("F1").Value = 6
Debug.Print "ran"
End Sub

It does the first statement but will not execute the second. Nothing
else is open, nothing else is executed. What could possible be going
on. Range F1 does get updated to 6 but the debug line or for that
matter anything after the Range("F1").Value line does not run. Has
anyone ever had this problem. tried restarting excel but haven't
tried running it on another machine. Issue only happens on one
workbook.
 
Reply With Quote
 
 
 
 
TomPl
Guest
Posts: n/a
 
      29th Oct 2008
What else do you think it is supposed to do besides set the value in F1 = 6
and print the work "ran" in the Immediate window?

"lukecs" wrote:

> heres my sub
>
> Sub testing2()
> With Application
> .DisplayAlerts = True
> .EnableEvents = True
> .ScreenUpdating = True
> End With
> Range("F1").Value = 6
> Debug.Print "ran"
> End Sub
>
> It does the first statement but will not execute the second. Nothing
> else is open, nothing else is executed. What could possible be going
> on. Range F1 does get updated to 6 but the debug line or for that
> matter anything after the Range("F1").Value line does not run. Has
> anyone ever had this problem. tried restarting excel but haven't
> tried running it on another machine. Issue only happens on one
> workbook.
>

 
Reply With Quote
 
Sheeloo
Guest
Posts: n/a
 
      29th Oct 2008
By second statement you mean - Debug.Print "ran"?
What are you expecting it to do?

It is working fine. Debug output goes to Immediate Window...

"lukecs" wrote:

> heres my sub
>
> Sub testing2()
> With Application
> .DisplayAlerts = True
> .EnableEvents = True
> .ScreenUpdating = True
> End With
> Range("F1").Value = 6
> Debug.Print "ran"
> End Sub
>
> It does the first statement but will not execute the second. Nothing
> else is open, nothing else is executed. What could possible be going
> on. Range F1 does get updated to 6 but the debug line or for that
> matter anything after the Range("F1").Value line does not run. Has
> anyone ever had this problem. tried restarting excel but haven't
> tried running it on another machine. Issue only happens on one
> workbook.
>

 
Reply With Quote
 
lukecs
Guest
Posts: n/a
 
      30th Oct 2008
On Oct 29, 4:58*pm, Sheeloo <="to" & CHAR(95) & "sheeloo" & CHAR(64) &
"hotmail.com"> wrote:
> By second statement you mean - Debug.Print "ran"?
> What are you expecting it to do?
>
> It is working fine. Debug output goes to Immediate Window...
>
> "lukecs" wrote:
> > heres my sub

>
> > Sub testing2()
> > * * With Application
> > * * * * .DisplayAlerts = True
> > * * * * .EnableEvents = True
> > * * * * .ScreenUpdating = True
> > * * End With
> > * * Range("F1").Value = 6
> > * * Debug.Print "ran"
> > End Sub

>
> > It does the first statement but will not execute the second. *Nothing
> > else is open, nothing else is executed. *What could possible be going
> > on. *Range F1 does get updated to 6 but the debug line or for that
> > matter anything after the Range("F1").Value line does not run. *Has
> > anyone ever had this problem. *tried restarting excel but haven't
> > tried running it on another machine. *Issue only happens on one
> > workbook.


ya the VBA exits without an error at Debug.print "ran". It exits
right after changing the range no matter what the code before or
after. So even if I wrap it with on error goto error_exit or
something like that it will still exit.

hmmmm
I think I may have figured out the issue. A volatile UDF was causing
the error. So when the workbook updated a value it calculated the UDF
and then caused an error in the function. Its just strange that it
exited the sub that I ran this code from without an error message. I
guess I need to practice a little more robust error trapping in my
UDF's.

The error is caused by attempting to use application.evaluate in a UDF
that evaluates another UDF that does not properly return an error.
Its been corrected by checking for errors in the UDF and returning
CVErr(xlErrNA) if there is an error.

Thanks for the assistance hopefully provided enough info that it may
help someone else in the future.
 
Reply With Quote
 
Ron Rosenfeld
Guest
Posts: n/a
 
      30th Oct 2008
On Wed, 29 Oct 2008 14:35:53 -0700 (PDT), lukecs <(E-Mail Removed)> wrote:

>heres my sub
>
>Sub testing2()
> With Application
> .DisplayAlerts = True
> .EnableEvents = True
> .ScreenUpdating = True
> End With
> Range("F1").Value = 6
> Debug.Print "ran"
>End Sub
>
>It does the first statement but will not execute the second. Nothing
>else is open, nothing else is executed. What could possible be going
>on. Range F1 does get updated to 6 but the debug line or for that
>matter anything after the Range("F1").Value line does not run. Has
>anyone ever had this problem. tried restarting excel but haven't
>tried running it on another machine. Issue only happens on one
>workbook.


It works fine for me, in a regular module.

How do you know that the debug.print line did not run?
--ron
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
I think SP3 broke my OE dwaing Windows XP General 1 22nd Aug 2008 06:03 PM
Now im broke Alf General 16 14th Dec 2007 06:41 AM
Is my pc broke????? R. Sole Computer Hardware 20 27th Jun 2004 01:01 PM
MBR broke =?Utf-8?B?TW9ua2V5TnV0cw==?= Windows XP General 3 8th May 2004 02:58 PM
RE: I Broke It! =?Utf-8?B?c2Vhbg==?= Microsoft Dot NET 1 27th Mar 2004 02:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:34 AM.