Picture Too Large? What picture!!

RandyD123

Active Member
Joined
Dec 4, 2013
Messages
289
Office Version
  1. 2016
Platform
  1. Windows
I am getting this error when trying to close my file. Not sure how to stop it. My VBA code is below. If I get rid of the macro button and use Ctrl+s instead, there is no problem!!
112.png


VBA Code:
Sub RandyD()
Dim c As Range
Application.ScreenUpdating = False

'Generate Sheet Output "Result", Overwrite Old Sheet
On Error Resume Next
    Sheets("Result").Delete
    Sheets.Add after:=Sheets(Sheets.Count)
    ActiveSheet.Name = "Result"
    Sheets("Raw Data").Cells.Copy Range("A1")
On Error GoTo 0

With Sheets("Sheet2")  'Replace Airline With 2 Letters
    For Each c In .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))
        Range("G:G").Replace What:=c.Value, Replacement:=c.Offset(, 1), LookAt:=xlWhole, SearchOrder:=xlByRows, _
        MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
    Next
End With

n = Range("A" & Rows.Count).End(xlUp).Row
h = 4 'data start at row
For i = n To h Step -1
    j = WorksheetFunction.CountIf(Range("A" & n & ":A" & h), Cells(i, "A")) 'case insensitive
'        Debug.Print Cells(i - j + 1, "A").Resize(j, 11).Address
        Cells(i - j + 1, "A").Resize(j, 11).Sort Key1:=Columns(7), Order1:=xlAscending, Header:=xlNo  'Sort By 2 First Letters
        If i - j + 1 <> h Then
            Rows(i - j + 1).Insert  'Insert Row Between Different Dates
        End If
        i = i - j + 1
Next

'Combine Code & Flight Number
With Range("B4", Range("B" & Rows.Count).End(xlUp))
   .Value = Evaluate(.Columns(6).Address & "&" & .Columns(5).Address)
End With

'Time to Number Format
For Each c In Range("E4", Cells(Rows.Count, "E").End(xlUp))
    c = Replace(Left(c.Text, 6), ":", "")
Next

Range("C:D,F:H,J:J").Delete
Range("A3:E3").Value = Array("Date", "Airline", "Time", "PAX", "PCPAX")
Application.ScreenUpdating = True

End Sub

Thanks for any help with this.....!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
So, you get the error when the button exists, but not when you've deleted it?
 
Upvote 0
So, if you create a new button, does the error come back? And if so, how are you creating the button?
 
Upvote 0
How strange. Delete that button, and insert a shape, see if you can save. If so, then assign your macro to the shape, and see if it still allows you to save.
 
Upvote 0
How strange. Delete that button, and insert a shape, see if you can save. If so, then assign your macro to the shape, and see if it still allows you to save.
I thought the same thing, a shape produces that same result, picture too large.....
 
Upvote 0
The only thing that comes to mind is that the workbook is corrupt in some way. Can you recreate your functionality in a new workbook (without copying sheet objects from the old workbook into the new workbook)?.
 
Upvote 0
The only thing that comes to mind is that the workbook is corrupt in some way. Can you recreate your functionality in a new workbook (without copying sheet objects from the old workbook into the new workbook)?.
I can provide you a link the actual sheet with code, if that would help......?
 
Upvote 0
I can give you advice on recreating your workbook. How many sheets does it have? What is the functionality of each sheet? Do any of the sheets have VBA code? How many VBA non-sheet modules exist?
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,111
Members
452,302
Latest member
TaMere

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