Writing to a text file

aceee

Board Regular
Joined
Feb 21, 2008
Messages
239
Hi all,

this has been working for many years, now does not?

any ideas why?

Code:
On Error Resume Next
Open "c:\windows\system\filelog.ini" For Append As #1
Print #1, Format(Now, "dd/mm/yyyy") & " - - Destination: - " & ActiveSheet.Name
 Close 1
End Sub
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Does the macro not run? Does the macro run but not do anything? Does the macro give any errors? What happens when you step through the macro?

I copied it to a module and it worked fine.

Are you on a new machine? Are you on a network? Did your IT department lock anything down?

Did you exit XL and restart? How about Windows? Did you wear the same color socks today?
 
Last edited:
Upvote 0
What error is coming up?

Could it be that you are missing the beginning Subroutine code? If so, try add the following at the beginning of your code.

Code:
Sub appendtotext()
 
Upvote 0
this has been working for many years, now does not?
any ideas why?
Code:
On Error Resume Next
Open "c:\windows\system\filelog.ini" For Append As #1
Print #1, Format(Now, "dd/mm/yyyy") & " - - Destination: - " & ActiveSheet.Name
 Close 1
End Sub
No, because you're hiding the error report. Take that On Error out and give the system a chance to tell us.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,559
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top