The Bonnet cable snapped on my 2004 Volvo V40 and to make matters worse the alarm was sounding continuously. Apparently a micro switch on the bonnet lock mechanism detects an attempt to open the bonnet while the alarm is active so a broken cable can set it off. Any attempt to open the bonnet was futile so the drive home up the M6 was very noisy for several miles. Eventually the alarm staggered to a silence so has probably burnt out.
While at home there still remained the problem of opening the bonnet to fit a new cable. Any attempt to jiggle the bonnet free proved fruitless. Removing the main undertray was also pointless as the lock is still obscured by the radiator and radiator under tray. Removing the grille and gaining better access seemed a possibility but to do this would mean smashing the grille as the fixings were not accessible from the front. By carefully looking through the grille the lock can be seen to be fixed to the body frame by 10mm bolts:
One can be seen at the top left and another at the bottom centre, there is a third covered by the plastic moulding that forms the supporting frame for the alarm switch.
If the 2 plastic tags at the top right are carefully bent back the front plastic moulding can be removed.
By then forcing the remainder of the plastic bracket to the right with a screw driver access can be gained to the third 10mm bolt head, shown in this pic at the top centre:
I removed the 3x10mm bolts to release the lock mechanism from the body frame by using a 1/4" drive socket with a long extension that was able to reach through spaces in the grille. By easing the lock assembly forward while simultaneously lifting the bonnet it was possible to fully open the bonnet and then the inner bowden cable could be seen to have rusted away at the lock end.
A new bonnet cable was thus required. To enable fitting, the offside plastic wheel arch protector will need to be removed and also the red bonnet release lever in the cabin, this is removed by unscrewing two philips screws holding its bracket to the under dash. In my case the plastic cable outer was found to be sound and so I only replaced the inner cable. I managed to find some stainless inner cables of the correct diameter (1.25 mm) from a bike shop, they were intended as bicycle gear cables but being 2 metres in length were long enough. Nipples were fabricated for both ends and fixed at the correct length. This pic below shows the cable outer locating on the lock mechanism, it also shows the sprung lever that the inner cable attaches to: To date the repair has been completely successful, hopefully being of stainless steel the inner cable will not rust as did the original.