diff --git a/src/fileFormats/sampledSetWriters/csv/csvSetWriter.C b/src/fileFormats/sampledSetWriters/csv/csvSetWriter.C
index 8d69d32..b989428 100644
--- a/src/fileFormats/sampledSetWriters/csv/csvSetWriter.C
+++ b/src/fileFormats/sampledSetWriters/csv/csvSetWriter.C
@@ -185,7 +185,7 @@ void Foam::csvSetWriter<Type>::writeCoordHeader
 {
     if (points.hasVectorAxis())
     {
-        forAll(points, i)
+        forAll(points.axis(), i)
         {
             os << points.axis()[i];
             writeSeparator(os);
