Hi Old Traveler, and Welcome to Cruise-Chat!
Yes, as everyone said it is a 24 hour window. The 24 hours is back from the arrival at the port of the excursion. The cancellation is subject to a 25% charge.
They do have some lee way with this however. If this should happen, go to the info. desk and nicely ask one of the Pursers and explain. A nice request goes a long way when they have some discretion.
Since the question is about a pre-paid excursion once on board. They will not refund the credit card used for the purchase, instead they will credit the on board account. If the credit is not used by the end of the cruise, they will refund the money with a check on the morning of debarkation.
I hope you don't get sick!