Appreciated being remind of Muriel Spark's book which I read when it surfaced but since it has been suppressed in my mind.
A more penetrating reflection on Ecclesiastes is in Jennifer Hecht's "Doubt - A History."
Following Job, Ecclesiastes questions the meaning of human existence altogether.  According to Hecht, he is a nihilist and she is astounded his essay made it into the bible.
Ecclesiastes essentially says we didn't ask to be dumped here; make the best of it you can against constant reminders that "all is meaningless."  Frankl, Man's Search for Meaning, would be in spirit of Ecclesiastes.
Shakespeare has made the central question of human existence, "To be or not to be. That is the question."  Remains the question with greater urgency in a world convulsed every moment by human tragedy.  "Life's short.  Make fun of it." It is inexplicably meaningless.