Posts by browncoat

    I have a table that needs to automatically make calculations based on matching values in different columns and have attached the table. In the last column labeled Spec Mean, I want to subtract the mean value from the rows labeled NSB based on matched values of other columns (e.g. v.Con column = "NSB", value in 35S column matches the value in the current row). So if in the D1 column the value is -4.5, then it should subtract the value in the mean column from the row with NSB in the v.Con column and the value of -4.5 in the D1 column. This works unless the D1 column is blank. It doesn't subtract the value from the row with D1 blank even though they are both blank. How can I get it to match a blank value for these?


    This is the value in the column I am using to calculate


    =[@Mean]-(SUM(SUMIFS([Mean],[35S],[@35S],[v.Con],"NSB",[D1],[@D1])))


    Thanks!

    OK, you can't just replace every Long with LongPtr. Only pointers and handles need to be LongPtr. I'll have a detailed look when I have time (or failing that I'll just ask Andy when I see him next week :))

    Ah ok hopefully that's the problem. Thanks so much for your help! Crazy (or maybe not?) that you know the author! Small world??


    Also, I'd tried it like this. It also doesn't give me errors but it didn't work which is why I tried changing all of them.


    UserForm1

    basGDIPlus

    Module1

    Code
    Option Explicit
    
    Sub Button1_Click()
        UserForm1.Show
    End Sub

    You're passing pointers/handles around, so they will need to be LongPtr to work on 64bit Office, not Long.

    Hi Rory, thanks for responding. I have done that. As I mentioned in the first post, I replaced all to LongPtr and that resulted in a runtime error 54, file not found: olepro32.dll. A forum online said that for 64 bit I need replace that code and point to oleaut32.dll which I did. That resulted in no longer getting an error but the image still does not load.

    No I have not gotten it to work. Adding PtrSafe just prevents me from getting errors when it runs. See my very first post about the changes I've made attempting to get it to work. It looks like GdiplusStartup is returning a bad value or no value at all (I don't see any value) as when I run it the part following is skipped:


    Been scouring for hours and have only come across a few threads discussing converting PNG files so they are compatible in userforms but none of them work, possibly because I'm in 64 bit Excel. This one I've gotten to actually not give errors but it still doesn't work: https://www.excelforum.com/exc…-image-into-userform.html . I converted Long to LongPtr and replaced olepro32.dll with oleaut32.dll which was suggested for 64 bit Excel but still no luck despite no longer getting errors. No images will load.


    Wondering if this is a lost cause at this point. Unfortunately it has to be PNG because the API only uses PNG files. All help appreciated.

    I'd like to be able to have input from keyboard be utilized when the userform is open, regardless of what is active. I've tried the UserForm_KeyDown event but it's not getting picked up when I press a key. Is there a way to do this?

    I have the bound column and text column set correctly and it works fine when clicking the box and selecting a value, however I have a textbox where the user can manually enter the record ID and I'd like for the combobox to list that selected record. I am setting the .value to the bound column value, and this works, but the combobox is showing the number, not displaying the text column.