ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print / Write to text file and usage of buttons (https://www.excelbanter.com/excel-programming/384349-print-write-text-file-usage-buttons.html)

[email protected]

Print / Write to text file and usage of buttons
 
Hi gurus

I need to make an Excel vba to write to a log text file usage of
certain buttons on a userform.

So, when user clicks a button called "button1" on "userform1" this
information should be added in the end of text file with date and
username.
There are two problems I can't solve and need you help with.
a) how to write an event to a userform so that any button clicked runs
program to save to log file.
b) how to append to the file. I have used print and write for other
purposes, but this should append and not overwrite.

This is against news rules, but could you pls send your comments to
jari.toukkari...jippii.fi because I have a limited access to news
groups.

Thanks in advance.
Jari


Tom Ogilvy

Print / Write to text file and usage of buttons
 
instead of
Open "C:\FILEIO\TEXTFILE.TXT" For Input As #1
use

Open "C:\FILEIO\TEXTFILE.TXT" For append As #1

In the click event of each button, call the procedure that writes the file.



--
Regards,
Tom Ogilvy



" wrote:

Hi gurus

I need to make an Excel vba to write to a log text file usage of
certain buttons on a userform.

So, when user clicks a button called "button1" on "userform1" this
information should be added in the end of text file with date and
username.
There are two problems I can't solve and need you help with.
a) how to write an event to a userform so that any button clicked runs
program to save to log file.
b) how to append to the file. I have used print and write for other
purposes, but this should append and not overwrite.

This is against news rules, but could you pls send your comments to
jari.toukkari...jippii.fi because I have a limited access to news
groups.

Thanks in advance.
Jari




All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com