During walking, attention needs to be flexibly allocated to deal with varying environmental constraints. This ability may be affected by aging and lower overall executive function. The present study examined the influence of aging and executive function on the attentional costs of visually guided walking under different task demands. Three groups, young adults (n= 15) and elderly adults with higher (n= 16) and lower (n= 10) executive function, walked on a treadmill in three conditions: uncued walking and walking with regular and irregular patterns of visual stepping targets projected onto the belt. Attentional costs were assessed using a secondary probe reaction time task and corrected by subtracting baseline single-task reaction time, yielding an estimate of the additional attentional costs of each walking condition. We found that uncued walking was more attentionally demanding for elderly than for young participants. In young participants, the attentional costs increased significantly from uncued to regularly cued to irregularly cued walking, whereas for the higher executive function group, attentional costs only increased significantly from regularly cued to irregularly cued walking. For the group with lower executive function, no significant differences were observed. The observed decreased flexibility of elderly, especially those with lower executive function, to allocate additional attentional resources to more challenging walking conditions may be attributed to the already increased attentional costs of uncued walking, presumably required for visuomotor and/or balance control of walking. © 2014 Elsevier B.V.