Reputation: 3
The following string of code keeps returning the error expected name parameter and i can not figure out where the trouble is:
With ActiveSheet.Shapes.AddPicture(Filename:="C:\Users\" & user & _
"\Dropbox (Junior-Consult)\JC - Eksterne projekter\1 JC - Virksomheder\2017-18\Dansk Supermarked - Mapping af kvalitative kommentarer\4. Analyser\" & _
country(j) & "\Billeder\" & pic_pre(i) & ws_name(j) & ".jpg",
This code however works just fine:
"C:\Users\" & user & _
"\Dropbox (Junior-Consult)\JC - Eksterne projekter\1 JC - Virksomheder\2017-18\Dansk Supermarked - Mapping af kvalitative kommentarer\4. Analyser\" & _
country(i) & "\Sentiment\" & country(i) & "_sent_o_" & ws_name(j))
i cant figure out what part of my directory string is wrong?
Upvotes: 0
Views: 79
Reputation: 786
Your directory string is probably alright. You didn't end the first statement the right way. Maybe because your original string was so long you didn't see it. You can use multiple lines using _ like this:
With ActiveSheet.Shapes.AddPicture(Filename:="C:\Users\" & user & _
"\Dropbox (Junior-Consult)\JC - Eksterne projekter\1 JC - Virksomheder" & _
"\2017-18\Dansk Supermarked - Mapping af kvalitative kommentarer" & _
"\4. Analyser\" & _
country(j) & "\Billeder\" & pic_pre(i) & ws_name(j) & ".jpg")
Are we answering in the comments now? I missed that in the tutorial.
Upvotes: 1