Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Cell Value to Textbox Control name

Posted on 2014-04-13
10
Medium Priority
?
325 Views
Last Modified: 2014-04-13
I have a the value Sheet9.tbSig.text stored in Cells(2,7)

I have am using

Public LoggedInUser as String

to store the value in Cells(2,7)


I have the following call to open an Outlook e-mail and fill in all fields.  

Public Sub Mail_Export(ByRef mTO As String, ByRef mCC As String, mSubject As String, mBody As String)

Open in new window


I am using the following all to fill this:

Call OutlookEmail.Mail_Export(cboAssignedTo.Value, Sheet9.tbEPRUpdateCC, "(FOUO) " & cboMember.Text & " EPR Update(FOUO)", Sheet9.tbFOUO.Text & vbCrLf & vbCrLf & Sheet9.tbEPRUpdateBody.Text & vbCrLf & vbCrLf & _
  LoggedInUser   & vbCrLf & vbCrLf & Sheet9.tbFOUO.Text)

Open in new window


When I use the above call for the variable LoggedInUser it uses "sheet9.tbsig1" and not the value of sheet9.tbsig1.

however when I type in the immediate window LoggedInUser = sheet9.tbsig1  the text of tbsig1 is filled into the call procedure.  Any help on how to fix this so the value of the textbox is filled into the call procedure??

Thanks.
0
Comment
Question by:Chris Pfeiffer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39997187
HI,

Could you show where you assign the value of LoggedInUser   in the code

Regards
0
 
LVL 2

Author Comment

by:Chris Pfeiffer
ID: 39997188
LoggedInUser = Cells(UserIndex, 6)

Open in new window

0
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39997189
Hi,

in your question you say it comes from  Cells(2,7)

not Cells(something,6)

is that the problem?

Regards
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 2

Author Comment

by:Chris Pfeiffer
ID: 39997191
No sorry I was just typing it from memory.  it is Cells(UserIndex,7)  
UserIndex is just a placeholder for the row of the currently logged in user.
0
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39997199
which result gives this just before the call sub

Debug.Print TypeName(LoggedInUser)
0
 
LVL 2

Author Comment

by:Chris Pfeiffer
ID: 39997203
String
0
 
LVL 53

Expert Comment

by:Rgonzo1971
ID: 39997209
When you type LoggedInUser = sheet9.tbsig1 in the immediate window you assign a textbox
to the variable not a string

then when you Mail_Export sub uses it calls the default propertiy of the object which is in this case .Value

I suppose you have in Cells(UserIndex, 7)  the string "sheet9.tbsig1" that won't work

Regards
0
 
LVL 2

Author Comment

by:Chris Pfeiffer
ID: 39997210
I understand.  I just wanted to know if there was any way to pass the string to a textbox like when I type it into the immediate window?
0
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39997233
Sorry No
0
 
LVL 2

Author Closing Comment

by:Chris Pfeiffer
ID: 39997241
Thanks for the fast response.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question