Hello All,
I have some VBA code that will sometimes run just fine and sometimes will give an error. I am getting very frustrated and in need of some help ... I have tried various things, but just cannot find a solution.
First ... what I am trying to do ...
I have an embedded Word document with various bookmarks. These bookmarks corespondent to named ranges in the Excel workbook. My VBA code:
Here is the VBA code ...
If you examine the code, you will see starting with the statement, "With newWord", that I am reading a table in the Excel workbook to obtain the named range and the bookmark. Here is that table ...
[TABLE="class: grid, width: 1090"]
<colgroup><col><col><col><col><col span="2"><col><col></colgroup><tbody>[TR]
[TD]Bookmark[/TD]
[TD]Excel Range[/TD]
[TD]Word Bookmark[/TD]
[TD]Description[/TD]
[TD]Excel Content[/TD]
[TD]Word Content[/TD]
[TD]VBA Case[/TD]
[TD]Excel Sheet Num[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]hoaname[/TD]
[TD]hoaname[/TD]
[TD]HOA Name[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet19[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]hoa_city_state[/TD]
[TD]hoa_city_state[/TD]
[TD]HOA City and State[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet19[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]currentyear[/TD]
[TD]currentyear[/TD]
[TD]Current Year of Analysis[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet19[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]todays_date[/TD]
[TD]report_date[/TD]
[TD]Today's Date[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]cummunity_profile[/TD]
[TD]cummunity_profile[/TD]
[TD]Community Profile & Account Summary[/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]current_pctfunding_barchart[/TD]
[TD]current_pctfunding_barchart[/TD]
[TD]Current Pct Funding Horizontal Chart[/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]3[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]reserve_study_parameters[/TD]
[TD]reserve_study_parameters[/TD]
[TD]Reserve Study Parameters[/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]current_income_sources[/TD]
[TD]current_income_sources[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]current_expenses[/TD]
[TD]current_expenses[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]future_income_sources[/TD]
[TD]future_income_sources[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]res_comp_summary_table[/TD]
[TD]res_comp_summary_table[/TD]
[TD]Reserve Component Inventory Tables[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet3[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]allocation_bycategory_smallchart[/TD]
[TD]allocation_bycategory_chart[/TD]
[TD]Column chart of Reserve Fund by Category[/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]5[/TD]
[TD]Sheet4[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]income_and_expense_summary[/TD]
[TD]income_and_expense_summary[/TD]
[TD]Income and Expense Summary[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet18[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]annual_res_expenditures_chart[/TD]
[TD]annual_res_expenditures_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]all_annual_expenses_chart[/TD]
[TD]all_annual_expenses_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]pctfund_chart[/TD]
[TD]pctfund_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]annual_res_contrib_chart[/TD]
[TD]annual_res_contrib_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]startyear_reserve_expenses_chart[/TD]
[TD]startyear_reserve_expenses_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]reserve_balance_compare_chart[/TD]
[TD]reserve_balance_compare_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]pct_funded_compare_chart[/TD]
[TD]pct_funded_compare_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]spec_assess_risk_chart[/TD]
[TD]spec_assess_risk_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]contingency_fund_summary[/TD]
[TD]contingency_fund_summary[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]23[/TD]
[TD]eoy_contingency_chart[/TD]
[TD]eoy_contingency_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]24[/TD]
[TD]diyheading_yrs1[/TD]
[TD]diyheading_yrs1[/TD]
[TD]Heading text for DIY report[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]income_expense_summary1[/TD]
[TD]income_expense_summary1[/TD]
[TD]income expense summ yr 1-10[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]sheet13table2[/TD]
[TD]sheet13table2[/TD]
[TD]Reserve expenses yrs 1-10[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]27[/TD]
[TD]diyheading_yrs2[/TD]
[TD]diyheading_yrs2[/TD]
[TD]Heading text for DIY report[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]28[/TD]
[TD]income_expense_summary2[/TD]
[TD]income_expense_summary2[/TD]
[TD]income expense summ yr 11-20[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]29[/TD]
[TD]sheet13table6[/TD]
[TD]sheet13table6[/TD]
[TD]Reserve expenses yrs 11-20[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]diyheading_yrs3[/TD]
[TD]diyheading_yrs3[/TD]
[TD]Heading text for DIY report[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]31[/TD]
[TD]income_expense_summary3[/TD]
[TD]income_expense_summary3[/TD]
[TD]income expense summ yr 21-30[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]32[/TD]
[TD]sheet13table10[/TD]
[TD]sheet13table10[/TD]
[TD]Reserve expenses yrs 21-30[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]detail1 to detail 250[/TD]
[TD]comp_details_bookmark[/TD]
[TD]Individual detail tables[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]0[/TD]
[TD]Sheet6[/TD]
[/TR]
</tbody>[/TABLE]
Here is the issue I am having.
Sometimes when I execute the VBA, it gives me an error. It fails at inconsistent places. For example it might fail when attempting to copy/paste the named range, "income_expense_summary1". Or maybe at a different range/bookmark.
Other times, it will run without error and everything is as I wished it be.
I would so like it if someone can see what I am doing wrong ... cuz I am banging my head into wall trying to figure this out.
Thanks
Steve B.
I have some VBA code that will sometimes run just fine and sometimes will give an error. I am getting very frustrated and in need of some help ... I have tried various things, but just cannot find a solution.
First ... what I am trying to do ...
I have an embedded Word document with various bookmarks. These bookmarks corespondent to named ranges in the Excel workbook. My VBA code:
- Opens the embedded Word document
- Makes a copy of the document and then closes the embedded document to preserve its contents
- Within a loop in the VBA code, copies the various named ranges in the Excel workbook and pastes the content of the clipboard at the appropriate bookmark in the Word document. Also, depending on what I am trying to do it will paste as picture or table.
Here is the VBA code ...
Code:
Sub create_diy_report_latebinding()
Dim wdApp As Object
Dim wdDoc As Object
Dim newWord As Object
Dim oleObj As Object
Dim pasteobject As Range
Dim diy_excel_range As String
Dim diy_word_bm As String
Dim diy_excel_content As String
Dim diy_word_content As String
Dim diy_vba_case As Integer
Dim diy_sheet_num As Worksheet
Dim ws As Worksheet
Dim detailnum As String
Dim shownum As String
Dim i As Integer
Dim bmrange As String
Dim mytable As Object
Dim headertext As String
Dim errorcount As Integer
Application.ScreenUpdating = False
On Error GoTo errorhandler
errorcount = 0 ' Set errorcount to zero
Application.DisplayAlerts = False
Set oleObj = Sheet5.OLEObjects("diy_template")
oleObj.Verb Verb:=xlPrimary
oleObj.Activate
Application.DisplayAlerts = True
Set wdApp = oleObj.Object.Application
With wdApp
.Visible = True
.Activate
Set wdDoc = wdApp.Documents(1) ' wdDoc will be the embedded Word doc
.Documents.Add ' add a new document
Set newWord = wdApp.Documents(1) ' newWord will be the new blank document
End With
'Select and copy all content from DIY Template to the new Word document
wdDoc.Content.Copy ' copy contents from the diy template
newWord.Content.Paste ' paste contents into the new document
' Close the DIY Template to prevent changing it and then activate the new Word doc
wdDoc.Close (wdDoNotSaveChanges)
newWord.Activate
'
' Perform edits on the new Word document by copying and pasting content from RFA
With newWord
For Each c In Sheet5.Range("diy_report_bmnum") 'All values from table in Data Validation sheet
diy_excel_range = c.Offset(0, 1).Value
diy_word_bm = c.Offset(0, 2).Value
diy_excel_content = c.Offset(0, 4).Value
diy_word_content = c.Offset(0, 5).Value
diy_vba_case = c.Offset(0, 6).Value
Select Case diy_vba_case
Case 1 'Copy range and paste as text replace bookmark text with text from Excel range
' .Bookmarks(diy_word_bm).Range.InsertAfter (Range(diy_excel_range).Value) 'Copies single cell value after word bookmark
.Bookmarks(diy_word_bm).Range.Text = Range(diy_excel_range).Value 'Copies single cell value to replace word bookmark text
Case 2 'Copy range or table as picture and paste as picture
Range(diy_excel_range).CopyPicture
.Bookmarks(diy_word_bm).Range.Characters.Last.Paste
Case 3 'Copy chart from Sheet10 and paste as picture
Sheet10.ChartObjects(diy_excel_range).Activate
Sheet10.ChartObjects(diy_excel_range).Copy 'Copies chart from Excel and pastes as picture in Word
.Bookmarks(diy_word_bm).Range.PasteSpecial Link:=False, DataType:=15, Placement:=wdInLine, DisplayAsIcon:=False
Case 4 'Copy chart from Sheet7 and paste as picture
Sheet7.ChartObjects(diy_excel_range).Activate
Sheet7.ChartObjects(diy_excel_range).Copy 'Copies chart from Excel and pastes as picture in Word
.Bookmarks(diy_word_bm).Range.PasteSpecial Link:=False, DataType:=15, Placement:=wdInLine, DisplayAsIcon:=False
Case 5 'Copy chart from Sheet4 and paste as picture
Sheet4.ChartObjects(diy_excel_range).Activate
Sheet4.ChartObjects(diy_excel_range).Copy 'Copies chart from Excel and pastes as picture in Word
.Bookmarks(diy_word_bm).Range.PasteSpecial Link:=False, DataType:=15, Placement:=wdInLine, DisplayAsIcon:=False
Case 6 'Copy range or table and paste as table
Range(diy_excel_range).Copy ' copy range of cells as table from Excel
.Bookmarks(diy_word_bm).Range.Characters.Last.Paste ' paste to Word
.Tables(.Tables.Count).Rows.AllowBreakAcrossPages = False
.Tables(.Tables.Count).Shading.BackgroundPatternColor = wdColorAutomatic
.Tables(.Tables.Count).Borders.InsideLineStyle = wdLineStyleNone
.Tables(.Tables.Count).Borders.OutsideLineStyle = wdLineStyleNone
Case Else
End Select
' insert delay to ensure that all actions complete before going to next case
' Application.Wait (Now() + TimeValue("0:00:1"))
Next c
' copy all component details as picture and paste into word
For i = 250 To 1 Step -1 ' For each component item from 1 to 250, do in reverse order
Application.CutCopyMode = False 'clear clipboard
detailnum = "detail" & i
shownum = "show" & i
' Check if the item is included in the component list, if not skip
If Range(shownum).Value = 1 Then
Range(detailnum).CopyPicture ' copy range as picture from Excel
.Bookmarks("comp_details_bookmark").Range.Characters.Last.Paste
Application.CutCopyMode = False 'clear clipboard
Else
End If
Next i
End With 'End with newWord doc
' Update all fields in the document
newWord.TablesOfContents(1).Update
newWord.TablesOfFigures(1).Update
newWord.TablesOfFigures(2).Update
newWord.Fields.Update
' Format tables except the "Terms and Def" table
For Each mytable In newWord.Tables
If mytable.Title <> "terms" Then
mytable.Range.Font.Size = 9
mytable.Rows(1).HeadingFormat = True 'Set first row as table header
mytable.Rows(2).HeadingFormat = True 'Set second row as table header
mytable.Rows.AllowBreakAcrossPages = False ' prevent rows breaking across pages
Else
mytable.Shading.ForegroundPatternColor = -16777216 ' Set "terms" table for automatic color prevent different shading
mytable.Shading.BackgroundPatternColor = -16777216 ' Set "terms" table for automatic color prevent different shading
End If
Next
On Error GoTo dispmsg
newWord.sections(2).headers(1).Range.Text = Sheet5.Range("diy_header").Value
newWord.sections(2).headers(1).Range.Paragraphs.Alignment = 2 ' Right justify header
Set wdApp = Nothing
Set wdDoc = Nothing
Sheet16.Select
dispmsg:
Select Case errorcount
Case Is = 0
MsgBox "Reserve Study Report Complete", vbInformation + vbOKOnly, "Reserve Study Report"
Case Is > 0 'display message about an error was found
MsgBox "Reserve Study Report Created. A total of " & errorcount & " error(s) encountered during report creation. " & vbNewLine & vbNewLine & _
"The errors or likely minor. Try closing the Word document without saving. Then run this routine again." & vbNewLine & vbNewLine & _
"If error(s) persist, review the report for potential omissions of data such as tables and charts. " & _
"You may have to perform manual edits and changes.", vbCritical + vbOKOnly, "Reserve Study Report Errors"
End Select
Exit Sub
errorhandler:
MsgBox (diy_word_bm)
errorcount = errorcount + 1
Resume Next
End Sub
If you examine the code, you will see starting with the statement, "With newWord", that I am reading a table in the Excel workbook to obtain the named range and the bookmark. Here is that table ...
[TABLE="class: grid, width: 1090"]
<colgroup><col><col><col><col><col span="2"><col><col></colgroup><tbody>[TR]
[TD]Bookmark[/TD]
[TD]Excel Range[/TD]
[TD]Word Bookmark[/TD]
[TD]Description[/TD]
[TD]Excel Content[/TD]
[TD]Word Content[/TD]
[TD]VBA Case[/TD]
[TD]Excel Sheet Num[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]hoaname[/TD]
[TD]hoaname[/TD]
[TD]HOA Name[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet19[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]hoa_city_state[/TD]
[TD]hoa_city_state[/TD]
[TD]HOA City and State[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet19[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]currentyear[/TD]
[TD]currentyear[/TD]
[TD]Current Year of Analysis[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet19[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]todays_date[/TD]
[TD]report_date[/TD]
[TD]Today's Date[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]cummunity_profile[/TD]
[TD]cummunity_profile[/TD]
[TD]Community Profile & Account Summary[/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]current_pctfunding_barchart[/TD]
[TD]current_pctfunding_barchart[/TD]
[TD]Current Pct Funding Horizontal Chart[/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]3[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]reserve_study_parameters[/TD]
[TD]reserve_study_parameters[/TD]
[TD]Reserve Study Parameters[/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]current_income_sources[/TD]
[TD]current_income_sources[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]current_expenses[/TD]
[TD]current_expenses[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]future_income_sources[/TD]
[TD]future_income_sources[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]res_comp_summary_table[/TD]
[TD]res_comp_summary_table[/TD]
[TD]Reserve Component Inventory Tables[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet3[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]allocation_bycategory_smallchart[/TD]
[TD]allocation_bycategory_chart[/TD]
[TD]Column chart of Reserve Fund by Category[/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]5[/TD]
[TD]Sheet4[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]income_and_expense_summary[/TD]
[TD]income_and_expense_summary[/TD]
[TD]Income and Expense Summary[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet18[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]annual_res_expenditures_chart[/TD]
[TD]annual_res_expenditures_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]all_annual_expenses_chart[/TD]
[TD]all_annual_expenses_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]pctfund_chart[/TD]
[TD]pctfund_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]annual_res_contrib_chart[/TD]
[TD]annual_res_contrib_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]startyear_reserve_expenses_chart[/TD]
[TD]startyear_reserve_expenses_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]reserve_balance_compare_chart[/TD]
[TD]reserve_balance_compare_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]pct_funded_compare_chart[/TD]
[TD]pct_funded_compare_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]spec_assess_risk_chart[/TD]
[TD]spec_assess_risk_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]contingency_fund_summary[/TD]
[TD]contingency_fund_summary[/TD]
[TD] [/TD]
[TD]table[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet10[/TD]
[/TR]
[TR]
[TD]23[/TD]
[TD]eoy_contingency_chart[/TD]
[TD]eoy_contingency_chart[/TD]
[TD] [/TD]
[TD]chart[/TD]
[TD]picture[/TD]
[TD]4[/TD]
[TD]Sheet7[/TD]
[/TR]
[TR]
[TD]24[/TD]
[TD]diyheading_yrs1[/TD]
[TD]diyheading_yrs1[/TD]
[TD]Heading text for DIY report[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]income_expense_summary1[/TD]
[TD]income_expense_summary1[/TD]
[TD]income expense summ yr 1-10[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]sheet13table2[/TD]
[TD]sheet13table2[/TD]
[TD]Reserve expenses yrs 1-10[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]27[/TD]
[TD]diyheading_yrs2[/TD]
[TD]diyheading_yrs2[/TD]
[TD]Heading text for DIY report[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]28[/TD]
[TD]income_expense_summary2[/TD]
[TD]income_expense_summary2[/TD]
[TD]income expense summ yr 11-20[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]29[/TD]
[TD]sheet13table6[/TD]
[TD]sheet13table6[/TD]
[TD]Reserve expenses yrs 11-20[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]diyheading_yrs3[/TD]
[TD]diyheading_yrs3[/TD]
[TD]Heading text for DIY report[/TD]
[TD]range[/TD]
[TD]text[/TD]
[TD]1[/TD]
[TD]Sheet5[/TD]
[/TR]
[TR]
[TD]31[/TD]
[TD]income_expense_summary3[/TD]
[TD]income_expense_summary3[/TD]
[TD]income expense summ yr 21-30[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]2[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]32[/TD]
[TD]sheet13table10[/TD]
[TD]sheet13table10[/TD]
[TD]Reserve expenses yrs 21-30[/TD]
[TD]table[/TD]
[TD]table[/TD]
[TD]6[/TD]
[TD]Sheet13[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]detail1 to detail 250[/TD]
[TD]comp_details_bookmark[/TD]
[TD]Individual detail tables[/TD]
[TD]range[/TD]
[TD]picture[/TD]
[TD]0[/TD]
[TD]Sheet6[/TD]
[/TR]
</tbody>[/TABLE]
Here is the issue I am having.
Sometimes when I execute the VBA, it gives me an error. It fails at inconsistent places. For example it might fail when attempting to copy/paste the named range, "income_expense_summary1". Or maybe at a different range/bookmark.
Other times, it will run without error and everything is as I wished it be.
I would so like it if someone can see what I am doing wrong ... cuz I am banging my head into wall trying to figure this out.
Thanks
Steve B.