Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Why am I getting "Code execution has been interrupted" message


This is the same request as below, but now I've attached the code being used:

Sub Funds_Ops_Reconciliation()
'
Dim lngCount As Long
Dim FO As String
Dim TA As String
Dim FundsOps As String
Dim TrustAcct As String
Dim FileName As Variant


Application.DisplayAlerts = False
Application.ScreenUpdating = False

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Title = "Select the original Funds Ops Check Request file"
.Show
For Each FileName In .SelectedItems 'code stops here
TrustAcct = FileName
Next
End With

'Open workbooks
Workbooks.Open
FileName:="\\sandprdob01\StdReg\Escheat_TrustAcct\ Escheat_Trust_out.csv"
FO = ActiveWorkbook.Name 'code stops here

Workbooks.Open FileName:=TrustAcct
TA = ActiveWorkbook.Name 'code stops here

'Create values for Funds ops File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(FO).Activate
Range("H:H").Select
RC = WorksheetFunction.Count(Range("H:H"))
CA = WorksheetFunction.Sum(Range("H:H"))
FOTotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
FOCount = Format(RC, comma)

'Create values for Trust Acct File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(TA).Activate
RC = WorksheetFunction.Count(Range("F:F"))
CA = WorksheetFunction.Sum(Range("F:F"))

TATotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
TACount = Format(RC, comma)

ReconTotal = FOTotal - TATotal
ReconCount = FOCount - TACount
ReconTotal = Format(ReconTotal, "$ #,##0.00;$ -#,##0.00 ")

If ReconTotal < 0 Then
MsgBox "The reconciliation process is out of balance:" & _
vbCrLf & "Trust Acct sent checks amounting to: " & TATotal & _
vbCrLf & "Funds Ops sent checks amounting to: " & FOTotal & _
vbCrLf & "We are out of balance by " & ReconTotal & ""
End If

Workbooks(FO).Close
Workbooks(TA).Close

Application.ScreenUpdating = True
Application.DisplayAlerts = True

Workbooks("Funds Ops Return File macro.xls").Close

End Sub


The code stops in three places everything, regardless of file selected or
changes to code. I've been streamlining code and still it stops in the same
places. The only constant is that the files are on a server, and that file
retrieval is kind of slow.

Thanks in advance for assistance

---------------------------------
Chris Freeman
IT Project Coordinator
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Why am I getting "Code execution has been interrupted" message


i hate asking this, but have you rebooted your pc lately?

"Chris Freeman" wrote in message
...
This is the same request as below, but now I've attached the code being
used:

Sub Funds_Ops_Reconciliation()
'
Dim lngCount As Long
Dim FO As String
Dim TA As String
Dim FundsOps As String
Dim TrustAcct As String
Dim FileName As Variant


Application.DisplayAlerts = False
Application.ScreenUpdating = False

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Title = "Select the original Funds Ops Check Request file"
.Show
For Each FileName In .SelectedItems 'code stops here
TrustAcct = FileName
Next
End With

'Open workbooks
Workbooks.Open
FileName:="\\sandprdob01\StdReg\Escheat_TrustAcct\ Escheat_Trust_out.csv"
FO = ActiveWorkbook.Name 'code stops here

Workbooks.Open FileName:=TrustAcct
TA = ActiveWorkbook.Name 'code stops here

'Create values for Funds ops File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(FO).Activate
Range("H:H").Select
RC = WorksheetFunction.Count(Range("H:H"))
CA = WorksheetFunction.Sum(Range("H:H"))
FOTotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
FOCount = Format(RC, comma)

'Create values for Trust Acct File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(TA).Activate
RC = WorksheetFunction.Count(Range("F:F"))
CA = WorksheetFunction.Sum(Range("F:F"))

TATotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
TACount = Format(RC, comma)

ReconTotal = FOTotal - TATotal
ReconCount = FOCount - TACount
ReconTotal = Format(ReconTotal, "$ #,##0.00;$ -#,##0.00 ")

If ReconTotal < 0 Then
MsgBox "The reconciliation process is out of balance:" & _
vbCrLf & "Trust Acct sent checks amounting to: " & TATotal & _
vbCrLf & "Funds Ops sent checks amounting to: " & FOTotal & _
vbCrLf & "We are out of balance by " & ReconTotal & ""
End If

Workbooks(FO).Close
Workbooks(TA).Close

Application.ScreenUpdating = True
Application.DisplayAlerts = True

Workbooks("Funds Ops Return File macro.xls").Close

End Sub


The code stops in three places everything, regardless of file selected or
changes to code. I've been streamlining code and still it stops in the
same
places. The only constant is that the files are on a server, and that file
retrieval is kind of slow.

Thanks in advance for assistance

---------------------------------
Chris Freeman
IT Project Coordinator


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Why am I getting "Code execution has been interrupted" message


Patrick,
Yeah, I've tried everything. I completely rebuilt the file selection
function, from msofileopen to Getopenfilename, and it still does the same
thing. These lines had no line break on them before, and I'm thinking it may
have something to do with the open file process and Workbook.Open process
confilicting somehow.

I was just hoping someone had a tip or trick about this.

Thanks
--------------------------------------------------------------------------------------
Chris Freeman
IT Project Coordinator


"Patrick Molloy" wrote:

i hate asking this, but have you rebooted your pc lately?

"Chris Freeman" wrote in message
...
This is the same request as below, but now I've attached the code being
used:

Sub Funds_Ops_Reconciliation()
'
Dim lngCount As Long
Dim FO As String
Dim TA As String
Dim FundsOps As String
Dim TrustAcct As String
Dim FileName As Variant


Application.DisplayAlerts = False
Application.ScreenUpdating = False

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Title = "Select the original Funds Ops Check Request file"
.Show
For Each FileName In .SelectedItems 'code stops here
TrustAcct = FileName
Next
End With

'Open workbooks
Workbooks.Open
FileName:="\\sandprdob01\StdReg\Escheat_TrustAcct\ Escheat_Trust_out.csv"
FO = ActiveWorkbook.Name 'code stops here

Workbooks.Open FileName:=TrustAcct
TA = ActiveWorkbook.Name 'code stops here

'Create values for Funds ops File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(FO).Activate
Range("H:H").Select
RC = WorksheetFunction.Count(Range("H:H"))
CA = WorksheetFunction.Sum(Range("H:H"))
FOTotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
FOCount = Format(RC, comma)

'Create values for Trust Acct File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(TA).Activate
RC = WorksheetFunction.Count(Range("F:F"))
CA = WorksheetFunction.Sum(Range("F:F"))

TATotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
TACount = Format(RC, comma)

ReconTotal = FOTotal - TATotal
ReconCount = FOCount - TACount
ReconTotal = Format(ReconTotal, "$ #,##0.00;$ -#,##0.00 ")

If ReconTotal < 0 Then
MsgBox "The reconciliation process is out of balance:" & _
vbCrLf & "Trust Acct sent checks amounting to: " & TATotal & _
vbCrLf & "Funds Ops sent checks amounting to: " & FOTotal & _
vbCrLf & "We are out of balance by " & ReconTotal & ""
End If

Workbooks(FO).Close
Workbooks(TA).Close

Application.ScreenUpdating = True
Application.DisplayAlerts = True

Workbooks("Funds Ops Return File macro.xls").Close

End Sub


The code stops in three places everything, regardless of file selected or
changes to code. I've been streamlining code and still it stops in the
same
places. The only constant is that the files are on a server, and that file
retrieval is kind of slow.

Thanks in advance for assistance

---------------------------------
Chris Freeman
IT Project Coordinator



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Why am I getting "Code execution has been interrupted" message


Patrick,
Thnaks, this time I completely shut down the computer, waited about a
minute, then restarted and its running without stopping now.

I guess so. Weirder things have happened on this computer.

Thanks
------------------------------------------------------
Chris Freeman
IT Project Coordinator


"Patrick Molloy" wrote:

i hate asking this, but have you rebooted your pc lately?

"Chris Freeman" wrote in message
...
This is the same request as below, but now I've attached the code being
used:

Sub Funds_Ops_Reconciliation()
'
Dim lngCount As Long
Dim FO As String
Dim TA As String
Dim FundsOps As String
Dim TrustAcct As String
Dim FileName As Variant


Application.DisplayAlerts = False
Application.ScreenUpdating = False

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.Title = "Select the original Funds Ops Check Request file"
.Show
For Each FileName In .SelectedItems 'code stops here
TrustAcct = FileName
Next
End With

'Open workbooks
Workbooks.Open
FileName:="\\sandprdob01\StdReg\Escheat_TrustAcct\ Escheat_Trust_out.csv"
FO = ActiveWorkbook.Name 'code stops here

Workbooks.Open FileName:=TrustAcct
TA = ActiveWorkbook.Name 'code stops here

'Create values for Funds ops File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(FO).Activate
Range("H:H").Select
RC = WorksheetFunction.Count(Range("H:H"))
CA = WorksheetFunction.Sum(Range("H:H"))
FOTotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
FOCount = Format(RC, comma)

'Create values for Trust Acct File: _
Total of Serial numbers (since its a number field) _
Total of check amounts _
Count of Records
Workbooks(TA).Activate
RC = WorksheetFunction.Count(Range("F:F"))
CA = WorksheetFunction.Sum(Range("F:F"))

TATotal = Format(CA, "$ #,##0.00;$ -#,##0.00")
TACount = Format(RC, comma)

ReconTotal = FOTotal - TATotal
ReconCount = FOCount - TACount
ReconTotal = Format(ReconTotal, "$ #,##0.00;$ -#,##0.00 ")

If ReconTotal < 0 Then
MsgBox "The reconciliation process is out of balance:" & _
vbCrLf & "Trust Acct sent checks amounting to: " & TATotal & _
vbCrLf & "Funds Ops sent checks amounting to: " & FOTotal & _
vbCrLf & "We are out of balance by " & ReconTotal & ""
End If

Workbooks(FO).Close
Workbooks(TA).Close

Application.ScreenUpdating = True
Application.DisplayAlerts = True

Workbooks("Funds Ops Return File macro.xls").Close

End Sub


The code stops in three places everything, regardless of file selected or
changes to code. I've been streamlining code and still it stops in the
same
places. The only constant is that the files are on a server, and that file
retrieval is kind of slow.

Thanks in advance for assistance

---------------------------------
Chris Freeman
IT Project Coordinator



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Why am I getting "Code execution has been interrupted" message



hi Chris,

Your comment that Weirder things have happened on this computer suggests that it may be worth running Rob Bovey's code cleaner addin
over your VBA projects.
'VBA Code Cleaner' (http://www.appspro.com/Utilities/CodeCleaner.htm)

Not so relevant, but you may also find some helpful suggestions on Dave
Mcritchie's page - there's a huge variety of info here about possible
impacts on computer performance:
'Slow Response, Memory Problems, and Speeding up Excel'
(http://www.mvps.org/dmcritchie/excel/slowresp.htm)

hth
Rob


--
broro183

Rob Brockett. Always learning & the best way to learn is to
experience...
------------------------------------------------------------------------
broro183's Profile: http://www.thecodecage.com/forumz/member.php?userid=333
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=109378

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
Alien abduction of VB: "Code execution has been interrupted..." Paul B. Excel Programming 3 July 31st 08 03:02 AM
VBA "Code execution interrupted" error on End Sub and End IF c0mmands?? Allan P. London, CPA Excel Programming 0 May 13th 08 09:01 PM
How to Diagnose Why "Code Execution has been interrupted" Neal Zimm Excel Programming 1 January 23rd 08 04:20 AM
Code Execution has been interrupted message Rich in Yorktown Excel Programming 1 December 20th 04 05:41 PM


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