He never matriculated and remained in Uppsala only one semester, before switching to a military career in accordance with the wishes and traditions of the family, enrolling in the Adelsfanan ("Banner of Nobles") cavalry regiment, and a few years later transferring to the drabantkåren (Garde du Corps).
As this did not take all of his time – different detachments of the Garde du Corps served at the royal court for only brief periods each year – he worked on his father's estate Höberg in Norra Vånga parish in Västergötland, which he managed on his own from 1784.
His main interest ever since youth was entomology, and already in 1775 he had collected some 1300 largely unidentified beetle species from the western part of Götaland.
His main publication was the Insecta Suecica, describing the insects of Sweden, which took him 30 years to complete and was awarded the gold medal of the Academy of Sciences.
His grandson, the Swedish-American journalist Anders Leonard Gyllenhaal (1842–1905), retained the faith of his grandfather and was a member of the Swedenborgian New Church.