LoadPicture() error XL2007

Hello,

I have an ActiveX image control (=93stuGraphic=94) on a worksheet
=93wsStudent=94.

The following line of code is run from a  macro:

 wsStudent.OLEObjects("stuGraphic").Object.Picture =3D LoadPicture()

Running with XL2007, this runs without fail 95% of the time, but
occasionally it generates an error message =91Runtime error-2147417848
(80010108) Method =93Picture=94 of object =93IImage=94 failed.=92   Once I =
get
the error, it fails continually - restarting the application, or
closing & restarting Excel does not fix the problem.  The only fix
I=92ve found to date (besides re-booting the computer) is to start up an
identical backup of the application, which runs without error.  Now,
when I go back to the original, it runs without a hitch.

I=92ve been playing with this for days, but can=92t replicate the error,
it just seems to occur without warning.  I=92ve set up this line in a
test loop, it will run for hours without failing.  I=92m starting to
suspect a memory leak of some kind in my main application.

Oddly enough (maybe not), I=92ve yet to have a failure running the same
code under XL2003.

If anyone can shed some light on this, I=92d be most appreciative.
Thanks in advance.

Regards,

DaveU
0
Dave
4/27/2010 3:58:16 AM
excel.programming 6508 articles. 2 followers. Follow

3 Replies
842 Views

Similar Articles

[PageSpeed] 37

Nasty!
Try and identify where the problem starts from with something like this

Sub test()
Dim sPic As String
Dim ole As OLEObject
Dim stdPic As StdPicture

    sPic = "C:\<path>\myPic.jpg"

    Set ole = ActiveSheet.OLEObjects("Image1")
    Logit "ole.Name " & ole.Name, True
    'Set stdPic = New stdole.StdPicture

    Set stdPic = LoadPicture(sPic)
    Logit "stdPic.Handle " & stdPic.Handle
    Set ole.Object.Picture = stdPic
    'or simply
    'ole.Object.Picture = stdPic
    Logit "ole.Object.Picture.handle " & ole.Object.Picture.Handle

End Sub

Function Logit(s As String, Optional bNew As Boolean)
Dim sLog As String
Dim ff As Integer

    sLog = Application.DefaultFilePath & "\Logit.txt"
    If bNew Then
        On Error Resume Next
        Kill sLog
        On Error GoTo 0
    End If

    ff = FreeFile
    Open sLog For Append As #ff
    Print #ff, s
    Close #ff

End Function

Regards,
Peter T

"Dave Unger" <dave.unger@sasktel.net> wrote in message 
news:a7e14f59-85ee-4ea9-8437-d95aaec877af@y14g2000yqm.googlegroups.com...
Hello,

I have an ActiveX image control (�stuGraphic�) on a worksheet
�wsStudent�.

The following line of code is run from a  macro:

 wsStudent.OLEObjects("stuGraphic").Object.Picture = LoadPicture()

Running with XL2007, this runs without fail 95% of the time, but
occasionally it generates an error message �Runtime error-2147417848
(80010108) Method �Picture� of object �IImage� failed.�   Once I get
the error, it fails continually - restarting the application, or
closing & restarting Excel does not fix the problem.  The only fix
I�ve found to date (besides re-booting the computer) is to start up an
identical backup of the application, which runs without error.  Now,
when I go back to the original, it runs without a hitch.

I�ve been playing with this for days, but can�t replicate the error,
it just seems to occur without warning.  I�ve set up this line in a
test loop, it will run for hours without failing.  I�m starting to
suspect a memory leak of some kind in my main application.

Oddly enough (maybe not), I�ve yet to have a failure running the same
code under XL2003.

If anyone can shed some light on this, I�d be most appreciative.
Thanks in advance.

Regards,

DaveU 


0
Peter
4/27/2010 9:55:17 AM
Hi Peter,

Thanks for your reply, I'll have a look at your suggestion.

regards,

DaveU

On Apr 27, 3:55=A0am, "Peter T" <peter_t@discussions> wrote:
> Nasty!
> Try and identify where the problem starts from with something like this
>
> Sub test()
> Dim sPic As String
> Dim ole As OLEObject
> Dim stdPic As StdPicture
>
> =A0 =A0 sPic =3D "C:\<path>\myPic.jpg"
>
> =A0 =A0 Set ole =3D ActiveSheet.OLEObjects("Image1")
> =A0 =A0 Logit "ole.Name " & ole.Name, True
> =A0 =A0 'Set stdPic =3D New stdole.StdPicture
>
> =A0 =A0 Set stdPic =3D LoadPicture(sPic)
> =A0 =A0 Logit "stdPic.Handle " & stdPic.Handle
> =A0 =A0 Set ole.Object.Picture =3D stdPic
> =A0 =A0 'or simply
> =A0 =A0 'ole.Object.Picture =3D stdPic
> =A0 =A0 Logit "ole.Object.Picture.handle " & ole.Object.Picture.Handle
>
> End Sub
>
> Function Logit(s As String, Optional bNew As Boolean)
> Dim sLog As String
> Dim ff As Integer
>
> =A0 =A0 sLog =3D Application.DefaultFilePath & "\Logit.txt"
> =A0 =A0 If bNew Then
> =A0 =A0 =A0 =A0 On Error Resume Next
> =A0 =A0 =A0 =A0 Kill sLog
> =A0 =A0 =A0 =A0 On Error GoTo 0
> =A0 =A0 End If
>
> =A0 =A0 ff =3D FreeFile
> =A0 =A0 Open sLog For Append As #ff
> =A0 =A0 Print #ff, s
> =A0 =A0 Close #ff
>
> End Function
>
> Regards,
> Peter T
>
0
Dave
4/27/2010 6:14:54 PM
Hi Martin,

Thanks for your reply.  Your idea about "race conditions" makes a lot
of sense, and I suspect this is at the root of the problem.  Strangly
enough though, once it's failed while running normally, I can't step
thru it with the debugger either.  Maybe something gets "broken"
because of the "race" during the normal run.  I'll certainly give your
suggestions a try.

Luckily, the client is running XL2003, which so far hasn't run into
any problem with this application, but it does make me a bit nervous.

Thanks for sharing your insights on this.

regards,

Dave


On Apr 27, 6:55=A0am, Martin Brown <|||newspam...@nezumi.demon.co.uk>
wrote:
>
> I have not seen that particular one, but I have seen plenty like it.
> XL2007 graphics is a crock of shit. There are race conditions deep in
> the graphics code that allow objects to be manipulated before they have
> been fully instantiated. It seems to be worse on quad CPU kit.
>
> You could try adding a short delay before the failing line or a DoEvents
> to allow the system to catch up. I suspect that one of the reasons that
> charts in XL2007 are so glacially slow is to avoid it tripping up over
> race conditions when run on fast multiCPU boxes.
>
> Another indicator of a race condition is that it will always work OK if
> you step line by line in the debugger but fails sometimes at full speed.
>
> Regards,
> Martin Brown- Hide quoted text -
>
> - Show quoted text -

0
Dave
4/27/2010 6:25:55 PM
Reply:

Similar Artilces:

Error 0x00040820
Hola, Este error me esta dando al querer bajar los correos de exchange.. "ÆMicrosoft de tarea ServerÆ de Exchange informó de error (0x00040820) : errores en sincronización de fondo. En la mayoría de casos, la información además es disponible en un registro de sincronización en la carpeta de elementos Deleted. " Alguien tiene alguna idea de como puedo resolver este problema ya que reviso en el server y no encuentro nada fuera de lo normal. Saludos Javier Javieranria@hotmail.com Javier Compruebe su generaci�n y r�plica fuera de l�nea del ...

Msimn error #3
I'm wondering if anyone can help me. All of a sudden when i am opening up my Outlook Express it freezes. When i do ctrl/alt/del the box pops up and says Msimn not responding. Can anyone tell me what I need to do in order to fix this problem? Thanks in advance for any help!! ...

Out of Memory Error, Error Handling!
Hi, Note1: I currently have a macro that accesses thousands of rows of data in a particular worksheet of the same workbook & generates a summary. Hence, i want to check if there is sufficient memory space (that the m/c would not hang) and then continue to the next line of code. I am checking for "err.number <> 0" at specific points to determine if it is ok to continue and also using "application.cutcopymode = false" where ever applicable. Have i missed out on anything? Is there a specific error number for "out of memory" or something ? Further,...

Run-time error '-2147217900 (80040e14)'
I have a tree list control I want to populate with Categories based on a Client. The client number is input into a text box & then the update event populates the tree based on the selection. I get a syntax error when it tries to open the recordset based on the SQL. Two tables are invloved (Client & Categories; in a 1-to-many relationship on pID field). Here'e the code: Dim rstCategory As New ADODB.recordset, rstComponent As New ADODB.recordset Dim rstSubComponent As New ADODB.recordset Dim tvwTree As Object Dim nodX As Node Dim I As Integer Dim blnAllRecs As B...

CRM Outlook error
We are getting errors in the CRM Outlook client that seems to indicate that the user cannot authenticate with the web server. Tracking e-mails works OK, but when the user clicks "Regarding" to assign the email to an account (not the contact it was sent to), a "red-x" CRM error page comes up that says "An error has occured". The event log has errors that indicate a bad username and password. Loading CRM from IE works fine - no login box comes up. I have had her clear all passwords and clear the IE cache, but the error still shows up. It apparently start...

Sp2 issues and error messages
Hi I have just upgraded my SBS2003 server to Exchange SP2 and I am now repeatidly seeing two errors in the Applications Event log: MSExchangeAL and MSExchange SA with error codes 8231 and 9153 I have followed the links and read the KB articles but they seem to refer to a mixed environment with Exchange 5.5 which we have never had. Can someone tell me what I've done wrong please thanks A Hi, What are the text messages of the events? These might help: http://www.eventid.net/display.asp?eventid=8231&eventno=2553&source=MSExchangeAL&phase=1 http://www.eventid.net/displ...

Linking error LNK2001
Hi All, I am facing a very unique problem while compling my project in "Release" build. The project is building in DEBUG mode but giving linking error on Release build. Here is the error: Creating library Release/fnimqcmd.lib and object Release/fnimqcmd.exp CoIMQCmd.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Tidy(unsigned short)" (__imp_?_Tidy@?$basic_string@DU?$char_ traits@D@std@@V?$allocator@D@2@@std@@AAEXG@Z) CoIM...

error: 2147417848
I'm doing a quantitative frequency distribution in megastat "exel" when I click ok, the following appears : Error No. -2147417848 (Method 'Offset' of object 'Range' failed) has occurred in Frequency Distributions - Quantitative....... :( can somebody help me ..... Aundrea Open the Excel sheet, Then, press "Alt+F11".Microsoft Visual Basic opens up. Click on "Insert" tab, select 'Module". then, copy & paste the codes given below in the Module(code). Dim max_reihen As Integer, lowestRow As Integer, latestCol As Integer D...

Word Errors
I have had two constant errors for quite some time now. First a little back ground. I have a xServe G4 with OSX Server 10.3.4 providing authentication and home directories for my users. A xServe RAID is what I am using for my storage on the server. All clients have v.X Office on the computers, and all computers are running OSX 10.3.4. Here is my first error: You cannot save while the file is in use by another process. Try saving the file with a new name. (AutoRecovery save of Document1) After clicking ok this other message appears: Saving AutoRecovery file is postponed for Document1...

Event 1003 Error code 1000000a blue screen/system fail errors!
Hi I keep getting errors such as this below- Event Type: Error Event Source: System Error Event Category: (102) Event ID: 1003 Date: 24/05/2010 Time: 23:46:49 User: N/A Computer: CHRISS_ROOM Description: Error code 1000000a, parameter1 00000010, parameter2 00000002, parameter3 00000001, parameter4 804dab1b. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Data: 0000: 53 79 73 74 65 6d 20 45 System E 0008: 72 72 6f 72 20 20 45 72 rror Er 0010: 72 6f 72 20 63 6f 64 65 ror code 0018: 20 31 30 30 30 30 30 30 1000000 ...

Error 8270 ldap error
Hello, I've a big problem with exchange 2003 and one error : 8270 "LDAP returne error [34] not avaiable ...." This error flood my event log, and i don't find how to resolve the problem. On microsoft support i found : this error is caused by dns or network problem, but after test i'm almost sure there is no problem. (http://support.microsoft.com/default.aspx?scid=kb;en;313167) So my network contain several child domain link by VPN to my principal network. I've exchange only in the principal domain, and in child domain i've just executed setup /domainprep. So i...

Login Error
Hi, I have encounter this error everytime when I try to login to eEnterprise : " The Intellisol_Modules.vba project references some objects that cannot be found. These objects are listed in the file: C:\eEntrprs\INTELLI.txt " Does anyone knows how to solve this problem ? Thanks in advance. I do custom VBA work and so am familiar with this type of message. Someone has done some VBA programming to add some functionality to your eEnterprise application. When creating the VBA file, they were using a specific forms.dic file (your forms dictionary). If you have a different form...

account distribution error
For some reason, when an invoice is paid completely by a credit memo, we receive an error on the computer checks posting journal that "account not found" for Purchase disc available. However, when I look up the invoice in Payables Distribution Zoom, I see that there is an account coded for Purchases Discount Available. Can someone tell me why this would be happening?? This makes no sense to me. Any input would be appreciated. Thanks Barb ...

fraction display error
Hi All, I came upon an excel issue that, performing a web search, I do not find documented anywhere. When decimal numbers are displayed as fraction using Format-->Fraction (up to one digit), Excel selects the closest available fraction (supposedly). However it doesn't do it correctly. eg 0.1 displays as 0 rather than 1/9 1.3 displays as 1 1/3 rather than 1 2/7 Values between 0.2308 and 0.2361 display as 1/4 rather than 2/9. I am aware that these display values are not used in calculations, but what the hell? Excel should be selecting the closest available fraction, no?? I believe...

Error entering named instance reportserver path when installing sql reports package
We are installing sql report package on version 10 (SQL 2005). Our SQL report server url is https://servername/Reportserver$instancename and I can browse to it, no issues there. I entered the named sql instance when running Microsoft SQL server reporting wizard after installing it from cd2. Next when I enter this as the URL (https://servername/Reportserver$instancename) , it does not like the URL as it is looking for http://servername/ReportServer. How can I provide the path with the named instance? Is there a way to install this package? Thank you. Jack, I believe you are being a...

error creating tasks
I get a strange error about parameters being invalid when I attempt to create a new task. The exact message box text is: Please save the task order by clicking Save Task Order on the Actions menu in the tasks folder. This view must not be filtered or grouped for save task order to be available. Could not complete the operation. One or more parameter values are not valid. I've tried the fix under article 823475. It did not affect this problem. Any ideas? thanks in advance. Mike change the task view to "Detailed List", then go action>save task order -- ~jason k...

Getting an error on Report after formula.
Hi There, I am trying to show the Grand Total number in the Page Footer but all I get is an error when I view the report. My formula goes like this, =sum([DescriptionTotals]), DescriptionTotals is an expression in a query that looks like this DescriptionTotals: =Count([HeadDescriptions]). I am not sure what I am doing wrong. Thanks Dustin On Tue, 15 Jan 2008 15:36:01 -0800, Dustin wrote: > Hi There, > > I am trying to show the Grand Total number in the Page Footer but all I get > is an error when I view the report. My formula goes like this, > =sum([DescriptionTotals...

workflow error
Hi all, I have installed workflow GP 10 successfully. I could able to open worklfow website. Once I click on administration on Quick launch pane, the below error appears: "Property Not Defined:CompanyKeyID. An administrator must create this property in the profile administration tool". I don't know where do create this property. Can anyone help me? Thanks and regards, Vijay ...

Error in Outlook when opening records
Hi, I am using the RTM version 1.2 and the CRM server, web client and Email router works fine. I have installed the sales client for Outlook (2003) without problem. I can access the objects like the account list but when I click the New Account or open existing account I get error when it is trying to load the new windows. It only says Error - An error has occured. for more...... The only items I can open or create is activities. This was also the problem in the 1.2 Beta version but I was hoping it would not happen in the new version. Has anyone experienced this or has ideas? Regards, Siggi ...

Help on Error msaccess.exe programme error
Hi, Thanks In advance Have a form called form 1 when I run it get error how do I solve it All i am tring to do is make a fontend on each user machine: Copy a .mdb from d: (Common Drive) to c: drive then close this mdb (which is a different one to the copied one) on d: drive then open the c:drive mdb Use on open + on loan + on current Thanks Trev Private Sub Form_Current() DoCmd.Quit End Sub Private Sub Form_Load() On Error Resume Next Dim strIcon As String Dim strMsg As String Dim strTitle As String Dim strFrom As String Dim strTo As String Di...

Error Message Appearing
I have the following message appear when I save one of my files: “Excel could not save all the data and formatting you reently added to ‘File Name’. To return to your workbook wwithout saving click Cancel. If you want to continue saving changes without repairing the problem, Click Ok.” I then click on help to see what the problem is but nothing appears. What does this message mean and how can I fix it? Thanks, Jane. Maybe: XL: Error Message: Too Many Different Cell Formats http://support.microsoft.com/default.aspx?scid=213904 And if you ever have trouble opening this file, you may ...

LoadPicture() bug at runtime
I cant get past this bug: Try to use LoadPicture(path) to supply any .Picture property causes a weird Reserved function error message. Can anyone think of a way to get around this? Does anyone know the Mac toolbox call that could be Declared to return the picture's handle? I'm really hurting to figure this Mac issue out - it works perfectly as documented on Win, but not on Mac!! -seanA Hi, I am pretty sure this is just a bug that no one noticed during testing. Please take a moment to send a bug report to Microsoft. To do that, use the feedback feature from the Help menu. The ...

Office XP error message
When i try and open 2 needed folders in outlook i get this following message.. Unable to display the folder. Microsoft Outlook could not access the specified folder location. outlook:8001010118000000E42E1C0097000000FC2E1C0000000000DD C008B2347CA442B4D3B0C91014D6AD828200000000000038A1BB1005E5 101AA1BB08002B2A56C200006D737073742E646C6C00000000004E4954 41F9BFB80100AA0037D96E000000433A5C446F63756D656E747320616E 642053657474696E67735C5 can anyone help me please. All my work documents are in this folder. No changes have been make to outlook xp well not that i know of..Help please How big is yo...

Error -17099
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Email Client: pop Every email I send is blocked with Error -17099 suspected spam. i have spoken to my ISP and can send email using this account with different program. Happens regardless of address sending to or size of email what can I do? Can I reset the program somehow, I've tried the entering the account details again but no change. > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3355748948_864137 Content-...

New error on opening outlook 2002
I had accidently installed Plaxo, the address book update program. I uninstalled it and immediately after, started getting an error when I open Outlook: "Microsoft Visual C++ Runtime Library" is the window heading. The message is: "Runtime error! Program C:\Program Files\Microsoft Office\Office 10 \outlook.exe The application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information" After shutting down Outlook and opening again, it takes about four times as long to open, but opens succ...