Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default On Error Goto

I've noticed some erratic behavior on our network printers and I'm trying to
trap any potential errors and allow a user to select another printer if there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message. Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default On Error Goto

Lose the If then stuff .. you should be good to go.

Sub yoursub()
On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
Below:
MsgBox "Please select another printer..."

End sub
"ryguy7272" wrote:

I've noticed some erratic behavior on our network printers and I'm trying to
trap any potential errors and allow a user to select another printer if there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message. Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default On Error Goto

Hi Ryguy,

How and where have you declared
Below.

Try posting the relevant routine.



---
Regards.
Norman


"ryguy7272" wrote in message
...
I've noticed some erratic behavior on our network printers and I'm trying
to
trap any potential errors and allow a user to select another printer if
there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message.
Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default On Error Goto

I'm using ON's suggestion and I just got an error. This line causes the error:
Application.Dialogs(xlDialogPrinterSetup).Show

It only happens with one particular printer...

I can't figure out why...

--
RyGuy


"Norman Jones" wrote:

Hi Ryguy,

How and where have you declared
Below.

Try posting the relevant routine.



---
Regards.
Norman


"ryguy7272" wrote in message
...
I've noticed some erratic behavior on our network printers and I'm trying
to
trap any potential errors and allow a user to select another printer if
there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message.
Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default On Error Goto

Where do you have "Below" defined? How does it equate to true?

If Err.Number < 0 Then
MsgBox "Please select another printer..."
Application.Dialogs(xlDialogPrinterSetup).Show
End If


"ryguy7272" wrote:

I've noticed some erratic behavior on our network printers and I'm trying to
trap any potential errors and allow a user to select another printer if there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message. Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default On Error Goto

Hello

Attention, "on error goto" is not a same a "goto"

I propose :

Sub yoursub()
On Error GoTo E1
Application.Dialogs(xlDialogPrinterSetup).Show
S1: on error goto 0
MsgBox "Please select another printer..."

exit sub
E1: resume S1
End sub




"Office_Novice" a écrit dans le
message de ...
Lose the If then stuff .. you should be good to go.

Sub yoursub()
On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
Below:
MsgBox "Please select another printer..."

End sub
"ryguy7272" wrote:

I've noticed some erratic behavior on our network printers and I'm trying
to
trap any potential errors and allow a user to select another printer if
there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message.
Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default On Error Goto

Hi Ryguy,

=============
I'm using ON's suggestion and I just got an error. This line causes the
error:
Application.Dialogs(xlDialogPrinterSetup).Show

It only happens with one particular printer...

I can't figure out why...
=============


Try posting the relevant routine.



---
Regards.
Norman

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default On Error Goto

try somthing like this, If an error occurs it will show the printer dialog box.

Sub Ry()
On Error GoTo Below
' Whatever you procedure is





Below:
Application.Dialogs(xlDialogPrinterSetup).Show

End Sub

"ryguy7272" wrote:

I've noticed some erratic behavior on our network printers and I'm trying to
trap any potential errors and allow a user to select another printer if there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message. Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default On Error Goto

I tried that too, ON. It just keeps erroring, or going to the default
printer. The point for 'xlDialogPrinterSetup' line of code is to allow users
to actually...choose a printer. It just keeps giving me errors. Frustrating!

Most recent attempt was this:
Application.Dialogs(xlDialogPrinterSetup).Show
If Err.Number < 0 Then
MsgBox "Please select another printer..."
End If

I didn't know if the 'xlDialogPrinterSetup' should go inside the if...end if.
Well, I tried JLG's code, as written, and that didn't wokr for me either.

Any other thoughts on this matter?

--
RyGuy


"Office_Novice" wrote:

try somthing like this, If an error occurs it will show the printer dialog box.

Sub Ry()
On Error GoTo Below
' Whatever you procedure is





Below:
Application.Dialogs(xlDialogPrinterSetup).Show

End Sub

"ryguy7272" wrote:

I've noticed some erratic behavior on our network printers and I'm trying to
trap any potential errors and allow a user to select another printer if there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message. Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default On Error Goto

Private Sub YourProc()
On Error GoTo Below
'Paste your code between here

'And Here
Below:
msgbox " please select another printer..."
Application.Dialogs(xlDialogPrinterSetup).Show
End Sub

If you only see the default printer maybe you need to set up other printers
on that computer.

"ryguy7272" wrote:

I tried that too, ON. It just keeps erroring, or going to the default
printer. The point for 'xlDialogPrinterSetup' line of code is to allow users
to actually...choose a printer. It just keeps giving me errors. Frustrating!

Most recent attempt was this:
Application.Dialogs(xlDialogPrinterSetup).Show
If Err.Number < 0 Then
MsgBox "Please select another printer..."
End If

I didn't know if the 'xlDialogPrinterSetup' should go inside the if...end if.
Well, I tried JLG's code, as written, and that didn't wokr for me either.

Any other thoughts on this matter?

--
RyGuy


"Office_Novice" wrote:

try somthing like this, If an error occurs it will show the printer dialog box.

Sub Ry()
On Error GoTo Below
' Whatever you procedure is





Below:
Application.Dialogs(xlDialogPrinterSetup).Show

End Sub

"ryguy7272" wrote:

I've noticed some erratic behavior on our network printers and I'm trying to
trap any potential errors and allow a user to select another printer if there
is an error printing. This is my code:

On Error GoTo Below
Application.Dialogs(xlDialogPrinterSetup).Show
If Below = True Then
MsgBox "Please select another printer..."
End If

When I run the sub, I get a "Compile Error, Label not Defined" message. Can
someone please point my mistake.

Thanks,
Ryan--

--
RyGuy

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 GoTo 0 Freddy Excel Programming 12 February 9th 07 03:01 PM
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 06:59 PM
on error goto Gixxer_J_97[_2_] Excel Programming 2 March 16th 05 09:49 PM
On Error Goto doesn't goto Paul Excel Programming 1 October 15th 04 03:51 PM
On Error Goto doesn't goto Paul Excel Programming 0 October 15th 04 03:05 PM


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