I have this litle problem:
I have inserted a lot of data into a excel form. After that I wish to do a bit of sorting and all that stuf before I actually create a chart. So I used the subtotal routine.
Somehow this routine ignores my first row of data. Very well, I'll let it start at one row higher. But excel drops a messagebox to tell me this row doesn't contain any data. (hey tell me) and I have to push the "OK"button to continu.
I wonder, is there a method to programaticaly push the "OK" button so my litle program can continu without me sitting on the watch?

The code looks like this:

oRng = oSheet.Range("F4", "F" & einde + 4 & "")
        oRng.Select()
        oRng.Copy()

        PRang = oSheet.Range("AA4", "AA" & einde + 4 & "")
        PRang.PasteSpecial()

        oRng = oSheet.Range("I4", "I" & einde + 4 & "")
        oRng.Select()
        oRng.Copy()

        PRang = oSheet.Range("AB4", "AB" & einde + 4 & "")
        PRang.PasteSpecial()

        oRng = oSheet.Range("AA3", "AB" & einde + 4 & "")
        oRng.Select()
        oRng.Subtotal(1, Excel.XlConsolidationFunction.xlSum, 2, True, False, True)

Anyway, thanks in advance.

You could try putting the code in a try catch, and have the program run the code if it finds an exception. It will find said exception, then should just run the code. u should not need to worry about if it does not find the exception, as it will. if for some reasons the gremlins go away and it does not create an exception, put the code u have written here in a call statement, and have a call statement to that statement in both instances. Its not pretty, but should work.

Thanx a lot for the help. Unluckily the try catch didn't do anything, but even worse is the fact that i didn't read the message excel threw too well. Because when I puted some labels on top of my rows, as excel sugested, the messagebox went away and my code runs fluently :S

Me.stupid = true

i ask before about it and no one help even in MSDN forum

but you can try to make anew form as message box and use timer to close it after some time

This question has already been answered. Start a new discussion instead.