Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Error Handler Question

Hello,
I have one last question in regards to creating an Error Handler for an
existing Application. Im using a Call command for the below Macro
(SaveGame) inside a larger routine (noted below - Sub "Click"). Dave
Peterson was kind enough to help me with the SaveGame sub and now Im hoping
I can request one further review.

The sub Click is writing data to the Account Mgmt Checklist and later
Calls SaveGame that sends the data to the Docking Station noted below. My
Problem is if the Docking Station is open I get an error. I know how to
write a basic handler and have a message box come up in place of it, but Im
more or less looking to have it cease the process and then provide an
alternative and message. Since the normal working order would be - write to
Checklist, save to Docking Station and then pop-up a message to alert the
user this has been sent to a certain workgroup I would instead like it to
not only show a message box (such as Try again later), but stop the writing
processes and lastly NOT send the Msgbox noted below if an error is incurred.

Thanks once again in advance for all of your thoughts and advice Jenny B.

Option Explicit
Sub SaveGame()
Dim Dockwkbk As Workbook
Dim Actwks As Worksheet

Set Actwks = ActiveSheet
Application.ScreenUpdating = False

Set Dockwkbk = Workbooks.Open(Filename:="C:\Documents and Settings\Me
\Desktop\Docking Station.xls")
Actwks.Move _
befo=Dockwkbk.Sheets("account Mgmt Log")
Call WritetoMainPage
Dockwkbk.Save
Dockwkbk.Close savechanges:=False
Application.ScreenUpdating = True
End Sub

Sub click()

Dim ws As Worksheet
Set ws = Worksheets("T")

If Range("a3") = "" And Range("a4") = "" Then
MsgBox "Please Select NEW or Update"
Exit Sub
End If

If Range("f5") = "" Then
MsgBox "Enter Issue Number"
Exit Sub
End If
Application.ScreenUpdating = False
If Sheets("Account Mgmt Checklist").Range("a4") Then ws.Cells(4, 4) = "true"
If Sheets("Account Mgmt Checklist").Range("a3") Then ws.Cells(4, 5) = "true"
If Sheets("Account Mgmt Checklist").Range("a10") Then ws.Cells(8, 5) = "true"
If Sheets("Account Mgmt Checklist").Range("b10") Then ws.Cells(8, 1) =
"true"
If Sheets("Account Mgmt Checklist").Range("t9") Then ws.Cells(8, 7) = "true"
If Sheets("Account Mgmt Checklist").Range("u9") Then ws.Cells(8, 9) = "true"
If Sheets("Account Mgmt Checklist").Range("a8") Then ws.Cells(7, 4) = "Yes"
If Sheets("Account Mgmt Checklist").Range("A7") Then ws.Cells(7, 7) = "Yes"
If Sheets("Account Mgmt Checklist").Range("B7") Then ws.Cells(7, 7) = "No"
If Sheets("Account Mgmt Checklist").Range("e7") = 1 Then ws.Cells(19, 6) =
"DRS"
If Sheets("Account Mgmt Checklist").Range("e7") = 2 Then ws.Cells(19, 6) =
"Book Entry"
If Sheets("Account Mgmt Checklist").Range("e7") = 3 Then ws.Cells(19, 6) =
"Restricted"
If Sheets("Account Mgmt Checklist").Range("e7") = 4 Then ws.Cells(19, 6) =
"ESPP"
If Sheets("Account Mgmt Checklist").Range("e7") = 5 Then ws.Cells(19, 6) =
"See other Comments"
ws.Range("f21").Value = Sheets("Account Mgmt Checklist").Range("P5")
If Sheets("Account Mgmt Checklist").Range("t5") = 1 Then ws.Cells(21, 6) =
"Common Stock"
If Sheets("Account Mgmt Checklist").Range("t5") = 2 Then ws.Cells(21, 6) =
"Preferred Stock"
ws.Range("d5").Value = Sheets("Account Mgmt Checklist").Range("l4")
ws.Range("h5").Value = Sheets("Account Mgmt Checklist").Range("f5")

Call AddPage
Call SaveGame

MsgBox "This has been sent to Rogers Group for Review"

Application.ScreenUpdating = True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,091
Default Error Handler Question

Might want to post this in the proper
group:microsoft.public.excel.programming.

"Jenny B." wrote in message
...
Hello,
I have one last question in regards to creating an Error Handler for an
existing Application. I'm using a "Call" command for the below Macro
("SaveGame") inside a larger routine (noted below - Sub "Click"). Dave
Peterson was kind enough to help me with the SaveGame sub and now I'm
hoping
I can request one further review.

The sub "Click" is writing data to the "Account Mgmt Checklist" and later
Calls "SaveGame" that sends the data to the Docking Station noted below.
My
Problem is if the Docking Station is open - I get an error. I know how to
write a basic handler and have a message box come up in place of it, but I'm
more or less looking to have it cease the process and then provide an
alternative and message. Since the normal working order would be - write
to
Checklist, save to Docking Station and then pop-up a message to alert the
user this has been sent to a certain workgroup - I would instead like it
to
not only show a message box (such as Try again later), but stop the
writing
processes and lastly NOT send the Msgbox noted below if an error is
incurred.

Thanks once again in advance for all of your thoughts and advice - Jenny
B.

Option Explicit
Sub SaveGame()
Dim Dockwkbk As Workbook
Dim Actwks As Worksheet

Set Actwks = ActiveSheet
Application.ScreenUpdating = False

Set Dockwkbk = Workbooks.Open(Filename:="C:\Documents and Settings\Me
\Desktop\Docking Station.xls")
Actwks.Move _
befo=Dockwkbk.Sheets("account Mgmt Log")
Call WritetoMainPage
Dockwkbk.Save
Dockwkbk.Close savechanges:=False
Application.ScreenUpdating = True
End Sub

Sub click()

Dim ws As Worksheet
Set ws = Worksheets("T")

If Range("a3") = "" And Range("a4") = "" Then
MsgBox "Please Select NEW or Update"
Exit Sub
End If

If Range("f5") = "" Then
MsgBox "Enter Issue Number"
Exit Sub
End If
Application.ScreenUpdating = False
If Sheets("Account Mgmt Checklist").Range("a4") Then ws.Cells(4, 4) =
"true"
If Sheets("Account Mgmt Checklist").Range("a3") Then ws.Cells(4, 5) =
"true"
If Sheets("Account Mgmt Checklist").Range("a10") Then ws.Cells(8, 5) =
"true"
If Sheets("Account Mgmt Checklist").Range("b10") Then ws.Cells(8, 1) =
"true"
If Sheets("Account Mgmt Checklist").Range("t9") Then ws.Cells(8, 7) =
"true"
If Sheets("Account Mgmt Checklist").Range("u9") Then ws.Cells(8, 9) =
"true"
If Sheets("Account Mgmt Checklist").Range("a8") Then ws.Cells(7, 4) =
"Yes"
If Sheets("Account Mgmt Checklist").Range("A7") Then ws.Cells(7, 7) =
"Yes"
If Sheets("Account Mgmt Checklist").Range("B7") Then ws.Cells(7, 7) = "No"
If Sheets("Account Mgmt Checklist").Range("e7") = 1 Then ws.Cells(19, 6) =
"DRS"
If Sheets("Account Mgmt Checklist").Range("e7") = 2 Then ws.Cells(19, 6) =
"Book Entry"
If Sheets("Account Mgmt Checklist").Range("e7") = 3 Then ws.Cells(19, 6) =
"Restricted"
If Sheets("Account Mgmt Checklist").Range("e7") = 4 Then ws.Cells(19, 6) =
"ESPP"
If Sheets("Account Mgmt Checklist").Range("e7") = 5 Then ws.Cells(19, 6) =
"See other Comments"
ws.Range("f21").Value = Sheets("Account Mgmt Checklist").Range("P5")
If Sheets("Account Mgmt Checklist").Range("t5") = 1 Then ws.Cells(21, 6) =
"Common Stock"
If Sheets("Account Mgmt Checklist").Range("t5") = 2 Then ws.Cells(21, 6) =
"Preferred Stock"
ws.Range("d5").Value = Sheets("Account Mgmt Checklist").Range("l4")
ws.Range("h5").Value = Sheets("Account Mgmt Checklist").Range("f5")

Call AddPage
Call SaveGame

MsgBox "This has been sent to Roger's Group for Review"

Application.ScreenUpdating = True
End Sub



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
Infinite Loop in Error Handler chris Excel Discussion (Misc queries) 2 September 18th 07 02:10 AM
Error Handler sharad Excel Discussion (Misc queries) 1 September 17th 07 06:38 PM
What code do I use to attach event handler that will open my user. TeresaManley Excel Worksheet Functions 2 May 5th 07 09:55 PM
merge handler error with Briefcase JH Excel Discussion (Misc queries) 0 September 6th 05 02:52 AM
Error Handler Not Working Bill Excel Discussion (Misc queries) 0 August 25th 05 07:13 PM


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