Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with images 1

Status
Not open for further replies.

Kenja824

Automotive
Nov 5, 2014
949
0
0
US
We use Excel 2013

We have files for GM that we need to use the snipping tool to create an image from another program, then paste it into a particular excel file. A file will usually end up with anywhere from 1 to 20 pictures pasted into the sheet.

For some reason excel does not like these images. If I forget to change to a different tab and leave it on the pictures tab, then switch over to another program, usually NX as that is where we create the snipped pictures, when I return to excel it will lag extremely bad. Lately it is a 50-50 chance of it kicking me out of excel all together.

While I am working in the images tab, it lags quite a bit even if I dont bring another program to the front. I will select a picture and it might take upwards of 10 or 20 seconds before that picture will actually start moving. As annoying as that is, I can live with that. What I cannot deal with is Excel locking up every time I bring another program to the front and return to excel. I am certain it is the pictures I paste into it because if I switch tabs to another without pictures, then go make the snippet, and then return to excel and switch to the pictures tab to paste the picture, it never locks up. Only that is really hard to get used to when it is the only program that has that demand.

Has anyone else dealt with this problem or is it possible our excel is not installed right? The thing is, it is not just my computer. Others here are having the same issue.

Any help with this is appreciated.



 
Replies continue below

Recommended for you

So I created a test file in excel. I threw a bunch of meaningless crap on one tab. Threw several snippets of pictures just of this page on the other tab. It seemed to be working fine still and I was wondering if it was because it is still only 80KB in size. The GM files we use are over 3,000KB. I started typing in here to ask a question and before submitting, I went back to the excel file I had created and it kicked me out. So I also now know the size of the file is not a problem, though I didnt think 3,000KB was much to begin with.

I am attaching the test file I created. Keep in mind. that if you leave it on the "Design" tab, there likely wont be any problems. If you leave it on the "Pictures" tab, then go and work on other things for a couple minutes and return to it, that is when it should have a problem. If it doesnt for you, then it means either we have a setting causing problems, or a problematic installation, is my guess.

Thanks for the help.
 
 https://files.engineering.com/getfile.aspx?folder=17bef52b-2ddd-46fd-9d12-4568fab6ed05&file=Test1.xlsm
Save early, save often?

Do a Google search on "excel crashes on pasting pictures" to see if any suggestions seem to cover your case. I'd copy/paste, but there look to be a huge number of causes/complaints.
 
Hi, Ken,

I don't know why this happens. I know it has happened to me in a variety of settings over the past decades.

I'd use Events in VBA.

In the Worksheet_Deactivate event of the Pictures sheet I'd use...
Code:
Private Sub Workbook_Deactivate() 
 Application.CutCopyMode = False
End Sub

You may also need to clear the Windows clipboard.
Code:
Option Explicit

Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function EmptyClipboard Lib "user32" () As Long
Public Declare Function CloseClipboard Lib "user32" () As Long

Public Function ClearClipboard()
  OpenClipboard (0&)
  EmptyClipboard
  CloseClipboard
End Function

The just run ClearClipboard in the Deactivate event along with the other code.

Please post back with your success or lack thereof.

Oh, yes and add a Save as well!!!

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
This may also work
Code:
Option Explicit

Sub ClearClipboard()
    Dim oData   As Object   'object to use the clipboard
    
    Set oData = CreateObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
    oData.SetText Text:=Empty
    oData.PutInClipboard
    Set oData = Nothing
End Sub


Private Sub Workbook_Deactivate()
    Application.CutCopyMode = False
    
    ClearClipboard
    
    Application.DisplayAlerts = False
    ThisWorkbook.Save
    Application.DisplayAlerts = True
End Sub


Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Using the worksheet_deactivate event as suggested by Skip is not something I've ever done, but it sounds like a great idea, especially the ClearClipboard part.

I'll be interested to hear if it solves the problem.


Doug Jenkins
Interactive Design Services
 
Thank you everyone for the help. I apologize for not replying. For some reason Eng-Tips doesnt email me anymore when I get a response.

Strangely I sort of found what the problem is.

At the bottom right corner of excel there are three buttons for view settings just left of the zoom. GM's Ergo sheets are saved so the "Page Layout" option is selected. When it is on page layout, it causes all of our stuff to lag here if there are images involved. However, once I switched it to "Normal" I have not had a problem in three days of working with these files.

You will have to forgive me for not trying those Skip. These being GM files, and because multiple people here are having the problem, I wouldn't be able to fix this overall this way. That I can see at least. And I dont want to alter GM's files other than what I was showed to do to past images and fill out the cells that are not locked on other tabs.

I dont understand why the Page Layout setting messes us up with Images, but at least now we can work without the hassle. lol
 
Thank you 3DDave for the answer. I went back and clicked on Kenja824's name and see they are from Michigan so GM meaning General Motors makes sense. However contextually I couldn't make that leap.

Jim

 
Status
Not open for further replies.
Back
Top