An implementation of Visual Basic that is built into Microsoft products.
Hi,
The path is correct and my loop is having way to exit properly. What is the issue?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
It does not write to text file per codes below. What is the reason? There is proper values in the Excel file.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim Message0 As String
Message0 = ""
...
Write_to_Text_file Message0
End SubSub Write_to_Text_file(Para_Dummy As String)
Dim File0 As String, RowID As Integer
File0 = Replace(Replace(ActiveWorkbook.Path & "..\Index\RangeStatus.txt", "/", "\"), "http:", "")
RowID = 1Open File0 For Output As #1 Do While True RowID = RowID + 1 If Trim(Worksheets("Main").Cells(RowID, 1).Value) = "" Then Exit Do End If Write #1, Trim(Worksheets("Main").Cells(RowID, 1).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 2).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 3).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 4).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 5).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 6).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 7).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 8).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 9).Value) & "," & Trim(Worksheets("Main").Cells(RowID, 10).Value) Loop Close #1End Sub
An implementation of Visual Basic that is built into Microsoft products.
Hi,
The path is correct and my loop is having way to exit properly. What is the issue?