Hello,
Using stream.WhiteLine in a VBA script is giving me the Object variable or With block variable not set error msgbox. Clicking on the Debug button brings me to the line that is written
stream.WriteLine " "
This is happening at the end of the script. But, I've used the stream.WriteLine probably about 100 times up until this point. I DIM fso As New FileSystemObject in the first ten lines of the script. Then I Dim stream AS TextStream. Then I Set stream = fso.CreateTextFile ("C:\temp\Tech Soil Service Error.log", True).
As I've said, I probably use the streamWriteline at least 100 times before I get the Object variable or With block variable not set error msgbox.
The script is writing the stream.WriteLine to the error log file.
I've used this same construct for years and never had this issue before. I'm using Excel 2016.
Thanks,
George Teachman
Using stream.WhiteLine in a VBA script is giving me the Object variable or With block variable not set error msgbox. Clicking on the Debug button brings me to the line that is written
stream.WriteLine " "
This is happening at the end of the script. But, I've used the stream.WriteLine probably about 100 times up until this point. I DIM fso As New FileSystemObject in the first ten lines of the script. Then I Dim stream AS TextStream. Then I Set stream = fso.CreateTextFile ("C:\temp\Tech Soil Service Error.log", True).
As I've said, I probably use the streamWriteline at least 100 times before I get the Object variable or With block variable not set error msgbox.
The script is writing the stream.WriteLine to the error log file.
I've used this same construct for years and never had this issue before. I'm using Excel 2016.
Thanks,
George Teachman