Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Icon located on the desktop

Status
Not open for further replies.

gjsala

Technical User
Feb 20, 2003
107
US
I'm not sure if excel can do this but I would like to have an icon, maybe an excel shortcut, placed on the desktop. When this icon is "Doubled clicked" the Date, Time and the computer name is entered into a network excel file in three columns, saved and then closed so the user wouldn't see this. There will be multiple computers that will have this program on it and will be inputting information into this single file not overwritting the previous entry. I'm not sure where to begin so any help would be appricated.

Thanks.
 
Write a VBScript program ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Here's what I think you're trying to do. You have an excel file. There's a shortcut to it. When the Excel file opens, it runs a Macro(1). That macro finds the first unused row on the spreadsheet (2) (there is only 1 sheet in this file?) and fills in the three cells (3).

1
Code:
Sub Auto_Open()
    [red]<your macro name>[/red]
End Sub
2
Code:
intNxtRw=Range("a65536").End(xlUp).row
3
Code:
cells(intNxtRw,1)=date
cells(intNxtRw,2)=time
cells(intNxtRw,3)=environ("COMPUTERNAME")

_________________
Bob Rashkin
 
PHV,
I don't have VBScript and VBA is my only option. Do you have any ideas?

Thanks.
 

Does it have to be an Excel file?
What about regular text file, comma delimited? *.csv?
Excel can open it...
Code:
Open "X:\SomeFolder\MyFile.csv" for Output As #1
Print #1, Date,Time,Environ("COMPUTERNAME")
Close #1
(Thanks Bong :)


Have fun.

---- Andy
 
Andy,
I'm trying to make this as simple as possible for me and some other people. Excel is the only way I know how to make this work.

Thanks.
 

IMHO, this is as simple as it gets. You can use this code in Excel's VBA, or Word, or Access, or VB6.

All what it does is opens a text file, writes last line of data, and closes the text file. You can have this code in a small macro in Excel if you want to.

This way you don't have to worry about finding the last cell with info, moving to the next cell under it, write Date, then move to the next cell next to it, write Time, etc.

Ooops. Instead of:
for Output As #1
Use
for Append As #1
this way you will not overwrite what you have, you will just add to what you already have in this text file.

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top