Click here to Skip to main content
15,903,175 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionFile name in a cell [SOLVED] Pin
vijay248218-Nov-10 5:14
vijay248218-Nov-10 5:14 
AnswerRe: File name in a cell Pin
Dave Kreskowiak18-Nov-10 5:57
mveDave Kreskowiak18-Nov-10 5:57 
GeneralRe: File name in a cell Pin
vijay248218-Nov-10 20:13
vijay248218-Nov-10 20:13 
AnswerRe: File name in a cell Pin
Tarun.K.S18-Nov-10 18:55
Tarun.K.S18-Nov-10 18:55 
GeneralRe: File name in a cell Pin
vijay248218-Nov-10 20:12
vijay248218-Nov-10 20:12 
GeneralRe: File name in a cell Pin
Tarun.K.S18-Nov-10 20:45
Tarun.K.S18-Nov-10 20:45 
GeneralRe: File name in a cell Pin
vijay248218-Nov-10 21:27
vijay248218-Nov-10 21:27 
GeneralRe: File name in a cell Pin
Tarun.K.S18-Nov-10 22:26
Tarun.K.S18-Nov-10 22:26 
Well using Google
i found the following code:

VB
' Makes sure all variables are dimensioned in each subroutine.
     Option Explicit

     ' Access the GetUserNameA function in advapi32.dll and
     ' call the function GetUserName.
     Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
     (ByVal lpBuffer As String, nSize As Long) As Long

     ' Main routine to Dimension variables, retrieve user name
     ' and display answer.
     Sub Get_User_Name()

     ' Dimension variables
     Dim lpBuff As String * 25
     Dim ret As Long, UserName As String

     ' Get the user name minus any trailing spaces found in the name.
     ret = GetUserName(lpBuff, 25)
     UserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)

     ' Display the User Name
     ActiveCell.Value=UserName
     End Sub


Run the Get_User_Name macro.

I would suggest you to use google just like Dave said. its very helpful for developers!

Cheers! Smile | :)
GeneralRe: File name in a cell Pin
vijay248218-Nov-10 22:48
vijay248218-Nov-10 22:48 
GeneralRe: File name in a cell Pin
thatraja20-Nov-10 3:44
professionalthatraja20-Nov-10 3:44 
GeneralRe: File name in a cell Pin
Dave Kreskowiak19-Nov-10 1:50
mveDave Kreskowiak19-Nov-10 1:50 
GeneralRe: File name in a cell Pin
vijay248221-Nov-10 2:38
vijay248221-Nov-10 2:38 
GeneralRe: File name in a cell Pin
Tarun.K.S21-Nov-10 7:07
Tarun.K.S21-Nov-10 7:07 
QuestionQuit another application already running from my vb.net application[SOLVED] Pin
vijay248217-Nov-10 22:01
vijay248217-Nov-10 22:01 
AnswerRe: Quit another application already running from my vb.net application Pin
vijay248217-Nov-10 23:06
vijay248217-Nov-10 23:06 
QuestionHow to get Thread counting and Name ? Pin
JC.KaNNaN17-Nov-10 19:16
JC.KaNNaN17-Nov-10 19:16 
AnswerRe: How to get Thread counting and Name ? Pin
_Erik_18-Nov-10 3:40
_Erik_18-Nov-10 3:40 
AnswerRe: How to get Thread counting and Name ? Pin
Luc Pattyn18-Nov-10 3:52
sitebuilderLuc Pattyn18-Nov-10 3:52 
QuestionApplication crash [SOLVED] Pin
vijay248217-Nov-10 5:31
vijay248217-Nov-10 5:31 
AnswerRe: Application crash Pin
Dave Kreskowiak17-Nov-10 5:46
mveDave Kreskowiak17-Nov-10 5:46 
AnswerRe: Application crash Pin
Eddy Vluggen17-Nov-10 6:56
professionalEddy Vluggen17-Nov-10 6:56 
GeneralRe: Application crash Pin
vijay248217-Nov-10 21:39
vijay248217-Nov-10 21:39 
AnswerRe: Application crash Pin
David Mujica17-Nov-10 7:27
David Mujica17-Nov-10 7:27 
GeneralRe: Application crash Pin
vijay248217-Nov-10 21:41
vijay248217-Nov-10 21:41 
GeneralRe: Application crash Pin
Simon_Whale17-Nov-10 23:00
Simon_Whale17-Nov-10 23:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.