PDA

View Full Version : "Picture too large/truncated" error?



EdNerd
05-08-2007, 09:40 AM
I set a range one column by 189 rows, copy, and paste it into another range. I get "the picture is too large and will be truncated" error message. What am I doing to cause this? How can I get around it? I have DisplayAlerts=False, but it still comes up.

Ed

lucas
05-08-2007, 09:44 AM
How are you pasting it?
do you have to copy and paste?

EdNerd
05-08-2007, 11:06 AM
With wkb.Worksheets(strBch)
Set rngInfo = .Range(.Cells(5, numCol), .Cells(189, numCol))
End With

With wkb.Worksheets(strWks)
Set rngShow = .Range(.Cells(5, 4), .Cells(189, 4))
End With

rngInfo.Copy
rngShow.PasteSpecial xlPasteValuesAndNumberFormats

lucas
05-08-2007, 11:33 AM
Hi Ed,
could you explain exactly what your trying to do...
What I understand:
You want to copy a column (column 5) down to row 189 and paste that to worksheet strWks column 5 row 4??

EdNerd
05-08-2007, 12:03 PM
strBch and strWks are strings with Worksheets names.
numCol is a column called out by the code.
rngInfo has the information to be copied into rngShow.


With wkb.Worksheets(strBch) ' Go to this wks
' Set a range from Row 5 to Row 189 in Column numCol
Set rngInfo = .Range(.Cells(5, numCol), .Cells(189, numCol))
End With

With wkb.Worksheets(strWks) ' Go to this wks
' Set a range from Row 5 to Row 189 in Column 4
Set rngShow = .Range(.Cells(5, 4), .Cells(189, 4))
End With

rngInfo.Copy
rngShow.PasteSpecial xlPasteValuesAndNumberFormats


Everything is text or numbers. There are no pictures, images, clipart, drawing items, shapes, charts, etc etc.

Ed

lucas
05-08-2007, 12:07 PM
Ed...could you post your workbook please....you may have to have 5 posts to do that but you can post a bogus post and then go to post reply in the lower left of the last post and then after you put your text in scroll down till you find manage attachments. Just a sanitized version of your file.

EdNerd
05-08-2007, 01:42 PM
A "sanitized" version may take some doing, as all of the objects and ranges are set in previous Subs, including stuff from a UserForm. Although it might help if I took out all of the above and did not get the error.

It all basically works like this:
-- An Open macro hides every page except my "splash" page and fires a UserForm. The form populates a listbox from a named range on a worksheet.
-- The user selects their name. The form goes away and an InputBox asks for a password. If the password is no good, the workbook closes.
-- If the password is good, code looks in the row the name was found in for three values: the name of the worksheet the information is found in (strBch), the number of the column the information is found in (numCol), and the name of the worksheet to use to display the information (strWks).
-- The code uses these values to set rngInfo and rngShow, and then copy rngInfo into rngShow.
-- The cells copied contain only text and numbers. Nothing exceeds the 256 character limit. There are no comments. There are formulas in rngInfo, but I only care about copying the values back and forth.

Does that help at all?

Ed

lucas
05-08-2007, 02:50 PM
Ed,
I dimmed a few variables etc and changed the column variable(numCol) to a 1 so I could test it and I had no problems except a lot of info in the clipboard.

EdNerd
05-09-2007, 08:37 AM
Y'know, even if I could get rid of the prompt, it would be okay. But like I said, even DisplayAlerts = False doesn't stop it.

Ed

lucas
05-09-2007, 09:09 AM
did mine run without the error?

Cyberdude
05-09-2007, 12:51 PM
Ths only time I've gotten that error is when I'm using SHIFT+EDIT->COPY PICTURE.

I don't suppose you are using that feature, are you??
Sid

EdNerd
05-09-2007, 04:20 PM
lucas - Yes, your workbook ran fine with no errors.

Cyberdude - No, I'm not using CopyAsPicture. The code I'm using is in Post #5 above.

Thanks all for your brain power.

Ed

lucas
05-09-2007, 04:29 PM
Maybe it would help to know where the value for numCol is coming from?

EdNerd
05-10-2007, 07:51 AM
From my post #7 above:

-- An Open macro hides every page except my "splash" page and fires a UserForm. The form populates a listbox from a named range on a worksheet.
-- The user selects their name. The form goes away and an InputBox asks for a password. If the password is no good, the workbook closes.
-- If the password is good, code looks in the row the name was found in for three values: the name of the worksheet the information is found in (strBch), the number of the column the information is found in (numCol), and the name of the worksheet to use to display the information (strWks).
-- The code uses these values to set rngInfo and rngShow, and then copy rngInfo into rngShow.

There is a sheet with a list of user names. If the name and password are good, the Find function sets a range to the person's name. Offset is then used to grab these three values which are hard-coded on the same sheet in the same row as the name.

I sanitized a copy of the workbook and have attached it. You can work with it one of two ways:
-- Select a name from the drop down list, and use a password of 9999. This will show you the workbook the way it's supposed to functino.
-- The little yellow square on top of the form is normally invisible. It's a "magic button" to enter a "maintenance mode" that shows all the sheets to allow editing. I didn't need it, but the non-code-savvy "administrative assistants" did. Either that, or I go running over every time a formula breaks!

Ed

lucas
05-10-2007, 08:20 AM
it runs show sheet for me just fine....at what point do you get the error?

EdNerd
05-10-2007, 10:18 AM
With this workbook, I chose the first name in the list box. When it opened, I got the error.

So maybe it's machine-specific?

Ed

lucas
05-10-2007, 12:12 PM
Starting to sound like it....did you try it on a different machine?

EdNerd
05-10-2007, 02:07 PM
Yes. I watched the Admin Assistants open it and use it, and they got the same error. Maybe I just need to add a notice to users to ignore this error. I hate doing that, though, without understanding what it is and why it's coming up.

Ed

lucas
05-10-2007, 07:34 PM
Ed, I'm sorry I can't help with this as I have tinkered with it for a while and can't duplicate the error...maybe someone else could try it for you..

EdNerd
05-11-2007, 07:42 AM
Thanks for all your help. I'll just post a notice in the workbook if any user brings it up.

Ed