I have mild to moderate hearing loss for which I have RIC HAs that come with programs for different hearing situations. However there is one “hearing situation” for which the HAs are inappropriate. This is when the next door neighbour is playing loud music while I am trying to read. The solution so far is to remove the HAs and put on my BOSE  quietcomfort 25 headphones with the active noise cancelling (ANC) turned on - everything goes back to quiet so I can continue reading
What I would prefer to do is have an ANC program on my HAs that “blots out” all external sounds, just like the BOSE headphones do when used solely for noise cancelling.
It seems to me that the HAs must have all the necessary hardware for this situation and it is just a software programming task to create the program.
Does anyone know of  HAs that have such a feature/program?
My Aids have a mute program. Would that work?
What a great idea. I’m sure they could do it. I’m surprised it is not already an available program on my KS9/Phonak aids.
The Mute button on the Widex Moment app just turns off the hearing aids’ amplification, so I think in general the mute buttons do this on all hearing aids.
Yes of course all modern hearing aids have this mute facility through their smartphone app or remote control.
The mute function is fine for moderate noise levels, but if the OP wishes to achieve the same level of ANC as with the Bose, he’ll need to wear the Bose.
While it would be nice to a certain extent, it would also drive me crazy from my tinnitus.  Active cancel THAT, and now we’re talking.  
WH
Wouldn’t you need to have some severely occluding domes or moulds for that to work? There’s nothing your aids can do to block out noise that bypasses your aids.
If the HAs output the inverse of the sound coming at it, you could get there. Should be possible. Should be possible to stream and everything. Airpods Pro do it. Other fancy headsets do it. It isn’t even a new idea.
WH
Airpods are occluding so there’s a lot of passive isolation as well. Would it be possible for an open-fit hearing aid to output enough ‘inverse’ sound? Most of the time, they’re just augmenting the sound coming in. Active noise cancellation would require them to output as much energy as is entering the ear. Or would it? My physics is non-existent.
Even some energy in the right direction would help.
WH
When I turn to mute, I can’t hear a thing even in my right ear which is more open, has a much larger vent.
I guess that answers the question then.
For OP, with mild to moderate hearing loss, I think the answer is that it’s not possible with current technology. Even with mics muted and a closed fit, somebody with a mild to moderate loss will be able to hear loud noises with hearing aid microphones turned off (muted). An open fit, as many people with such loss have will make things worse. Hearing aids do not provide the kind of ANC that noise cancelling headphones do.
I’m guessing best option for somebody with mild to moderate loss is just to wear the noise cancelling headphones for reading. Could be worn over hearing aids or without hearing aids depending on comfort.
To do that, they’d need to measure the sound pretty close to the eardrum or at least in the ear canal. There’s nothing that does that yet. Modern noise cancelling headsets still rely pretty heavily on closing off the ear.
I agree with Neville’s take.  I sure wish highly effective passive and active noise reduction helmets were available when I was flying military helicopters in the 70s 
Looking at headsets for helicopter pilots, most rely on significant passive noise reduction. One relatively expensive model (US price of about $900) for which there are actual specifications (that I could find) on the active noise reduction stated that the active reduction was effective only between 20 Hz and 1 KHz and that the frequency for peak reduction was at 150 Hz.
Effective active noise reduction relies on supplying an additional signal of nearly the same sound pressure level and frequency as the noise source at the point where the sound is to be cancelled. For most people, that would be at the eardrum so the added signal and the noise would be 180 degrees out of phase and of equal amplitude to get full cancellation. Passively reducing the noise significantly before it reaches the eardrum is a typical first step for headsets/headphones designed to reduce noise as that reduces both the noise and required cancellation signal.
It seems to me that the easy way for hearing aid users to reduce noise would be to use sound protection muffs or headphones with significant passive reduction. That is typically done with muff/phones that go over the ear and seal completely against the head. I use some old-school large-cup “closed” headphones from Beyerdynamic over my Oticon OPN S1 aids without noticeable feedback. They passively reduce noise by about 20 db which is more than typical consumer level active noise reduction headphones provide.
Arguments for feasibility:
Hearing aids are positioned to put a microphone as close to the eardrum as anything I can think of.
Hearing aids already have ample power to cancel out ambient sound. I think of it like this: We hearing aid users cannot (to a greater or lesser degree) hear the ambient sound that reaches our eardrums, at least not well enough to fully understand it. But our hearing aids have the power to amplify the sound enough so we can hear and make use of it.
OP--  have you tried talking to your neighbor about the loud music? You might mutually decide on times when it is or is not appropriate for them to play loud music. Just a thought.
I’d suggest some over the ear hearing protectors worn over or without your hearing aids. You can get them pretty inexpensively online. I have a pair and wear them over my Costco bluetooth aids. When I mow the lawn with my  noisy lawn tractor, they dull the mower’s sound enough that I can listen to audiobooks or music through my HAs.
Noise cancellation takes more battery power and computing power than our small hearing aids to - unlike the Bose (per my engineer husband).
I had my fitter add a Custom program to my KS10s that is based on the ‘Very Noisy’ setting. We pushed the Dynamic Noise filter, the Wind Noise, etc to the highest setting (20). Basically the custom program is reducing as much as possible. The Noise I was focusing on was to reduce the noise from my Diesel truck when I’m driving. It works great. I only need press an HA button once to change into my custom ‘Extreme Noise’ program. To be fair, I own Bose Quiet comfort headphones that I used back when I was stacking up 2 million air miles. The HA custom program is NOT that good, but it is a handy to have compromise.