No method matching iterate(::XLSX.Worksheet)

file = XLSX.readxlsx(“ASG data 14.06.2018 (new data).xlsx”)
f_curves = file[“Curves”]
DP = f_curves[“C48:C56”] # (old) peak power consumption forecast by 2035, GW
Seasons = f_curves[“B28:E36”]
D=Seasons.*DP
f_gen_and_costs = file[“Generation_and_costs”]

MethodError: no method matching iterate(::XLSX.Worksheet)
Closest candidates are:
iterate(::Pkg.Resolve.NodePerm, ::Any…) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Pkg/src/Resolve/maxsum.jl:228
iterate(::Test.GenericString) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1589
iterate(::Test.GenericString, ::Integer) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1589

Hi, have you read the post: PSA: make it easier to help you? It is very helpful to those reading your question if you follow the conventions outlined there. In particular, it is very difficult to tell which line is throwing the error from the code you have posted, and a “minimum working example” would make it much clearer.

In addition, have you taken a look at the documentation for XLSX? It features a Tutorial · XLSX.jl that could shed light on what is happening.

2 Likes