Is there a way to pass an argument to a view without using the url?
Yes, your example does exactly what you're wanting. Read the docs on views_embed_view...


  "...: Any additional parameters will be passed as arguments."