Excel bug? - RESOLVED

If you think you've found a mistake in the software, tell us here

Excel bug? - RESOLVED

Postby adenlark » Tue Dec 19, 2017 2:28 pm

Hello Gavin

I had some issues a while ago (topic1397.html#p6327) getting my VBA code to fire. As I moved to other software for a while, I forgot about this. I've now rewritten the workbook from scratch, and the problem persists - Cymatic does not recognise that cells in BA:BC have been populated or updated by VBA. I threw together a sample workbook to test a few code samples, and narrow down the possibilities. In short, using formulas in BA:BC works fine. Using VBA to populate two or more columns does not work - Cy does not process or accept the commands, unless I edit one of the cells in BA:BC (for example by double-clicking then pressing enter). For reference, I use the exact same code, but with different cell references on other software, and it works as expected. That narrows it down to an issue with Cymatic, or an issue with Cy and the version of Excel I'm using. Windows 7, Excel 2007 with SP1 update.

**I've tried to attach the workbook, but .xlsm attachments are not allowed

Cheers

adenlark
Wealth can neither be created nor destroyed. It is simply transferred from one illusion to another. - some guy on the internet
adenlark
 
Posts: 83
Joined: Sun Aug 03, 2014 10:00 pm

Re: Excel bug?

Postby Gavin » Wed Dec 20, 2017 10:14 pm

H Adenlark,

I took a quick look at the Excel file that you emailed me. The problem is with this line in your Visual Basic code:

Code: Select all
Application.EnableEvents = False


That turns off the all the events, including the ones that Cymatic responds to.

When you populate the cells in BA :BD, Cymatic respond because it is watching for an event that Excel fires when cells have changed. If you turn off the events, then Cymatic doesn't get triggered.

Do you even really need to turn off Application.EnableEvents, I am guessing that you might not need it? If you do need it, perhaps because you want the loop to do a batch of work and then have the changes all executed together as a batch, then try populating the cells using by filling them as an array, instead of changing them one by one. It has been a while since I tested how Excel responds when you fill cell values one at a time, I think it responds to each one separately rather than waiting for you VBA code to complete and then handling them all, but I could be wrong.

Kind regards,

Gavin
User avatar
Gavin
Site Admin
 
Posts: 3832
Joined: Wed Jan 23, 2013 9:11 pm
Location: United Kingdom


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron