The picture is too large and will be truncated

SalmanGenProg

New Member
Joined
May 24, 2010
Messages
19
Dear All,

I am running a simple macro that copies and pastes data from one spreadsheet into another and then makes a calculation and loops around in order to repeat the procedure (usually around 40 or so times). The code is very simple and i'm pasting it below. Of late my spreadsheet has started to crash very often. I usually manage to get one full run out of it, but then it never runs the macro fully; always crashing a couple of turns into the PLoop variable (see below). And I then get an error message saying "The picture is too large and will be truncated". At that point excel also hangs and I have to restart the computer. My spreadsheet is relatively big (around 50MB and has around 9000 rows filled with links to other spreadsheets - each of which is around 50MB in size as well).

Any ideas as to how I could resolve this would be most appreciated.

Here's the code:

Code:
Sub LoadP()
On Error GoTo ErrorTrap
    Windows("Psizing.xlsm").Activate
        Range("MF") = 0
        Range("PF") = 0
    Windows("BCap.xlsm").Activate

'CLEANING UP OLD DATA IN ALL DUMP-SHEETS
    Workbooks("BCData").Activate
    Worksheets("ATRtracker").Select
    Range("ATRtrackerDump").Select
    ActiveCell.Range("A1:az10000").Select
    Application.CutCopyMode = False
    Selection.ClearContents
        
    Worksheets("PosTracker").Select
    Range("PosTrackerDump").Select
    ActiveCell.Range("A1:az10000").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    
    Worksheets("UBreak").Select
    Range("UBreakDump").Select
    ActiveCell.Range("A1:az10000").Select
    Application.CutCopyMode = False
    Selection.ClearContents
        Workbooks("BCap").Activate
    
    Worksheets("TLog").Select
    Range("TLogposting").Select
    Range(Selection, Selection.End(xlToRight)).Select
    ActiveCell.Range("A1:I5000").Select
    Application.CutCopyMode = False
    Selection.ClearContents

    Worksheets("Control Panel").Select
    Range("FirstMark").Select
    Range("g8:dx8").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
    Selection.ClearContents
    
    ActiveCell.Offset(-1, 0).Range("A1").Select
    
    Calculate
    
    LoopLength = Range("TotalM")
    
'COPYING DATA INTO THE DUMP-SHEETS
    
    Sheets("Bio 2.0").Select
    Application.Goto Reference:="DateSet"
    Selection.Copy
    Sheets("Control Panel").Select
    Range("datadumpstart").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
       
    For PLoop = 1 To LoopLength
        Worksheets("Control Panel").Select
        Range("PItemStart").Select
        ActiveCell.Offset(PLoop - 1, 0).Range("A1").Select
        Selection.Copy
            Sheets("Bio 2.0").Select
            Application.Goto Reference:="sMkt"
            Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    
    Calculate
        
        Application.Goto Reference:="DlyPL"
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Control Panel").Select
        Range("DataDumpStart").Select
        ActiveCell.Offset(1, PLoop + 1).Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False

        Sheets("Bio 2.0").Select
        Application.Goto Reference:="InitialP"
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Control Panel").Select
        Range("InitialPRef").Select
        ActiveCell.Offset(0, PLoop).Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False

        Sheets("Bio 2.0").Select
        Application.Goto Reference:="OpenTD"
        Application.CutCopyMode = False
        Selection.Copy
            Workbooks("BCData").Activate
        Sheets("PosTracker").Select
        Range("PosTrackerDump").Select
        ActiveCell.Offset(0, PLoop - 1).Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
        
            Workbooks("BCap").Activate
        Sheets("Bio 2.0").Select
        Range("DTstop").Select
        Application.CutCopyMode = False
        Selection.Copy
            Workbooks("BCData").Activate
        Sheets("ATRtracker").Select
        Range("ATRtrackerDump").Select
        ActiveCell.Offset(0, PLoop - 1).Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
                
            Workbooks("BCap").Activate
        Sheets("Bio 2.0").Select
        Range("UBreak").Select
        Application.CutCopyMode = False
        Selection.Copy
            Workbooks("BCData").Activate
        Sheets("UBreak").Select
        Range("UBreakDump").Select
        ActiveCell.Offset(0, PLoop - 1).Range("A1").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
        Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
        
            Workbooks("BCap").Activate
        Sheets("Bio 2.0").Select
        Application.Goto Reference:="TList"
        Application.CutCopyMode = False
        Selection.Copy
        Application.Goto Reference:="TLogPosting"
        
        Let ScrollLength = Range("TotalTrs") ' + 1
        
TLogLoop:
        
            If ActiveCell.Offset(0, 0).Range("a1") = "" Then
                Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
                SkipBlanks:=False, Transpose:=False
            Else
                ActiveCell.Offset(ScrollLength, 0).Range("a1").Select
                Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                :=False, Transpose:=False
                Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
                SkipBlanks:=False, Transpose:=False
            End If
    
    ActiveSheet.Calculate

   Next

    'CLEANING UP THE BOTTOM PART OF THE TLOG DUMP
    Application.Goto Reference:="TLogPosting"
    Calculate
    Let ScrollLength = Range("TotalTrs") ' + 1
    ActiveCell.Offset(ScrollLength, 0).Range("A1:I1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.ClearContents
    Range("A1").Select

    
    Worksheets("control panel").Select
    Range("A1").Select
    Calculate
    
    Exit Sub
ErrorTrap:
    response = MsgBox("Something went wrong")
End Sub
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,215,509
Messages
6,125,216
Members
449,215
Latest member
texmansru47

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top