Consulting

Results 1 to 3 of 3

Thread: [Solved] Referring to a String within Quotations

  1. #1

    [Solved] Referring to a String within Quotations

    Hi all.

    Could someone please tell me how I refer to a String within quotations.

    At the beginning of my code I have.

    Dim Name As String
    Name = Cells(1, 1)
    I use this to save a filename of a document as 'Name'.

    Later on I am trying to identify the file in this line of code (Name being the string referred to earlier)
    Call Body.EMBEDOBJECT(1454, "", "C:\Users\x\Documents\x\Name")
    Does anyone know what I need to do make this work?

    Thanks in advance.
    Last edited by patricevease; 01-20-2016 at 07:52 AM.

  2. #2
    Sorry - solved this.

    For everyone that wants to know how to refer to a variable within quotations this is the new code I used:

    "C:\Users\x\Documents\x\" & Name & ""

  3. #3
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    This suffices:

    "C:\Users\x\Documents\x\" & Name

Posting Permissions

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