It got it, finally. With the IsNull function I had made the division between land and sea. At first I couldn't find out what to do next (hence my previous post), but in the end I used the Zonal Fill function (input zone = my dem, input weight = IsNull output), filtering out the non-land part. Then I used Raster to Polygon and Polygon to Line to get the coastline. Maybe Raster to Polyline would have worked as well, but I didn't try it.