Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Opening notepad from excel


  • Please log in to reply
No replies to this topic
anoop
  • Guests
  • Last active:
  • Joined: --
Hi Expert,

I'm facing issues in opening a notepad and writing into it. First i write a code for opening notepad and writing some custom message in that note pad the code is

Open "C:\Users\Desktop\FTP\FormatLog.txt" For Append As #1
               Print #1, "*         ROW " & RowNdx & " having differemt server location             *"
               Close #1


But when i use the same code in another sub function it is not creating or writing into the file. But i tried from another one at that time it is working
the code that didnt work for me is

If ColNdx = Dollarscheck2 Then
          ' If RowNdx >= 2 Then
          ' curentdollar = Cells(RowNdx, ColNdx).Value
          ' totaldollar = curentdollar + totaldollar
          ' End If
            If RowNdx > 1 Then dummydollar = Cells(RowNdx, ColNdx).Value
         If dummydollar <> correctdollar Then
         count = 1
            MsgBox "MissMatch in ROW" & RowNdx & " COLUMN " & ColNdx
            Open "C:\Users\Desktop\FTP\FormatLog.txt" For Append As #1
               Print #1, "MissMatch in ROW" & RowNdx & " COLUMN " & ColNdx ' this is not working
               Close #1
              


             
             
         End If
           Cells(RowNdx, ColNdx).Select
           Selection.NumberFormat = "@"
           Cells(RowNdx, ColNdx).Value = Format(Cells(RowNdx, ColNdx), "0.00")
           
         End If 

Could you please anyone give me the resolution to text the msgbox content i,e MsgBox "MissMatch in ROW" & RowNdx & " COLUMN " & ColNdx to the specified text file


With Regards,
Anoop