Results 1 to 2 of 2

Thread: Somethings amiss

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2018
    Posts
    1

    Somethings amiss

    Perhaps I know too much...to my way of thinking, any of the below lines (3-9) accomplish what I'm trying to do:

    Code:
    Dim mostArgs
    
    Set mostArgs = ""
    Set mostArgs = " "
    Set mostArgs = Chr(20)
    Set mostArgs = CStr("")
    Set mostArgs = CStr(" ")
    Set mostArgs = CStr(Empty)
    Set mostArgs = Null
    
    Set mostArgs = mostArgs & " " & "theRest"
    All throw errors.

    Thanks in advance for any insight you can provide.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,930

    Re: Somethings amiss

    Welcome to VBForums

    When you get errors, tell us what the messages are - because the messages usually tell us exactly what the issue is (even if you don't understand the message), which makes things easier for us.

    In this case I can see that you are using the keyword Set when you shouldn't, because you are trying to use a standard data type (String) rather than an Object.


    By the way, most of those variations you showed will do noticeably different things ("" is the same as CStr(""), and " " is only the same as CStr(" "), but everything else is different).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width