How to concatenate a literal string and a variable value?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Bansten

    #1

    How to concatenate a literal string and a variable value?

    Assume I want to concatenate a literal text value and a variable value for a function parameter
    then the following does NOT work:

    objWorkbook.Sav eAs("D:\work\v1 _" + Filename)

    The variable "Filename" is filled with a valid value.

    So how do I otherwise concatenate two parts?

    Tony

  • sloan

    #2
    Re: How to concatenate a literal string and a variable value?



    What is the object type for "FileName"

    Do you have
    OPTION EXPLICIT ON
    OPTION STRICT ON

    or do you have

    dim Filename
    (which means dim Filename as object)
    ............

    or do you have ?
    dim fileName as string

    Are you using VB.NET?

    If you're not, then why are you posting to a VB.NET newsgroup
    (microsoft.publ ic.dotnet.langu ages.vb)?





    "Tony Bansten" <tonytony@hotma il.comwrote in message
    news:48e51d7f$0 $6614$9b4e6d93@ newsspool3.arco r-online.net...
    Assume I want to concatenate a literal text value and a variable value for
    a function parameter
    then the following does NOT work:
    >
    objWorkbook.Sav eAs("D:\work\v1 _" + Filename)
    >
    The variable "Filename" is filled with a valid value.
    >
    So how do I otherwise concatenate two parts?
    >
    Tony
    >

    Comment

    Working...