How do I solve this error about Operation ''__'' is supplied with 0 arguments, but takes 1 arguments.

HolyCrusader 1 Reputation point
2022-12-14T04:34:07.757+00:00

Shapes.AddImage()''C:\Users\Admin\Downloads\top-19-tourist-spots-in-baguio-philippines-burnham-park-camp-john-hay-strawberry-farm-3.avif")
This is my code right now.
Can anyone tell me why this isn't working?

Small BASIC
Small BASIC
A programming language created by Microsoft that serves a stepping stone for beginners from block-based coding languages to more complex text-based languages.
277 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Small Visual Basic 411 Reputation points
    2022-12-15T00:52:17.993+00:00

    I agree with @Absolute Beginner
    but also, your code has two syntax errors:

    1. you closing parans before the image path, makes the AddImage method takes zero argument.
    2. You used two apostrophes `` at the start of the path while you should use a quote ". The apostrophe makes the rest of the line just a comment, and this is why you don't get a syntax error about this.

    So, the correct syntax is:

       Shapes.AddImage("C:\Users\Admin\Downloads\top-19-tourist-spots-in-baguio-philippines-burnham-park-camp-john-hay-strawberry-farm-3.avif")  
    

    but this may cause a runtime error as @Absolute Beginner explained. Besides, I don't expect that SB will accept the avif extension, but I didn't try, so it will not hurt if you do.

    Note:
    I hope this is not just a homework question and you made us solve it for you :)

    1 person found this answer helpful.