PDA

View Full Version : [Solved] Referring to a String within Quotations



patricevease
01-20-2016, 07:34 AM
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.

patricevease
01-20-2016, 07:53 AM
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 & ""

snb
01-20-2016, 08:54 AM
This suffices:


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