:)Īgain.I'm using Windows 7, Excel 2007 & Excel 2010, and VB.NET 2010 Express.Thanks. That's just an idea until we can think of something else. Does anyone have a workaround, so that this change event does not have to be used with the worksheet? That's one way to get the VB.NET program to work properly for the Application.ScreenUpdating (by stripping out for as many cases as you would likeĪpplication.ScreenUpdating = True 'I commented this out and it still has no affect on the flickering. 'My section of code (modified for simplicity and for testing purposes): 'Commented out the more lengthy complicated code someone else wrote, which calls other subroutines etc. Private Sub Worksheet_Change(ByVal Target As Range)Īpplication.ScreenUpdating = False 'I commented this out and it still has no affect on the flickering. Here's the Excel VBA code (that's in the worksheet): So the challenge is to find if there's a solution to this, so that the Excel VBA code for the change event doesn't have to be stripped out, and that the VB.NET program with the Application.ScreenUpdating = False/True works properly So as I try to solve this conflict, would any of you all like to find it before I do? :) In that Excel VBA subroutine (that I show below) I commented out the other code and isolated the smaller section of code that I wrote and it still flickers Part of it was written by someone else to find things and there's a section in there (that I forgot that I wrote) that changes the color of cells, depending Actually some of this VBA code is useful (but not really necessary). I examined the Excel VBA code more closely. :) I was curious which part of the Excel VBA code in the worksheet conflicts with the ScreenUpdating when using VB.NET. I'd like to give you all an update let's call it another version. As always, everything is subject to change as we find better information, but hopefully this is it (without any other problems or errors). If you have any suggestions for improvement, please let us know. I'm able to still preserve the VBA code in the worksheet change event (without stripping it out) and now I can run the VB.NET code without the Excel screen flickering. However trying to piece all the information together for VB.NET (in place of Excel VBA for Excel sheets) took me some time to figure out. I read things on the internet that made this simple. VB6 for MS Excel for many years just recently I've switched to VB.NET. ![]() I use arrays in VB.NET all the time the syntax is different than VBA but I figured it out. ![]() Thank you for the links also.haven't looked at them yet.but will a little later. The code runs faster which pleases me, because other sections of my code should run faster now too (when there was flickering).Īgain, I appreciate very much your reply. I don't know why there's a conflict,īut when the VBA code was removed, there was no flickering at all (when running it from VB.NET 2010 Express for Excel). The code in the worksheet was written by someone else that had no use for what I was doing. I stripped out the Excel VBA code for that worksheet (not the VBA code in the Excel modules). I was reading on the internet some related issues, However, just minutes ago I discovered the solution. I tried the method you suggested and it works that way in VB.NET, but the Excel screen still flickers. I'm using Windows 7 and the VB.NET references are such so that my code works for both Excel 2007 and Excel 2010. ![]() ![]() So far, I like what I see with VB.NET 2010 Express. I'm just starting this again at a whole new level. Me specific examples that are understandable and work, as I just started using VB.NET (preferably from someone that also writes code in VB.NET for MS Excel that knows the solution)? Previously many years ago I was using VB6 and Excel VBA. If there's a suggestion about using the backgroundworker, could you provide for I find that hard to believe since VB.NET 2010 Express is such a good tool. I've found from my own experience (and heard) that VB.NET is unable stopĮxcel flickering (when writing code in VB.NET for Excel). I read about LockWindowUpdate, Suspend/ResumeLayout, and using a BackgroundWorker etc.but nothing makes any sense or works or functions as it should without errors. Private Sub ProgramForExcelSheet(etc., etc.) Here's my pseudo code, so that you can understand what I'm saying: The ScreenUpdating to work just as it does when using Excel VBA. How do I stop the Excel screen from flickering with the code written in VB.NET? In other words, I would like to have VB.NET 2010 Express accepts my code for the following (without a run-time error) however the Excel screen still flickers. I've already done an extensive search, but I haven't found an answer that is I'm using successfully VB.NET 2010 Express in place of Excel VBA for Excel worksheets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |