The answer to your question really depends on how much power the attic fan requires. The ones I've seen require quite a bit of power, and the number of solar cells and batteries that you'd have to install to drive the motor would be high. The capital cost for this venture would be very significant. There's maintenance on solar cells to consider. Of course, solar will lower the utility bill, itself. Whether this is economical depends on a number of factors.
As far as functioning, if you can provide sufficient power with solar, I doubt it would make any noticeable difference to you.