Community
    • Login

    Excel VBA copy to NP++ dword is garbled, vice versa

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 3 Posters 493 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bwiselyB
      bwisely
      last edited by

      When I try to copy the excel built-in VBA code to notepad++, the dword text (my text is traditional Chinese) becomes garbled.
      When notepad++ shows the correct dword copy to excel VB, the text becomes garbled.
      how to let the chinese text as correct text, not garbled text.

      thanks

      EkopalypseE PeterJonesP 2 Replies Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @bwisely
        last edited by

        @bwisely

        Can you provide a screenshot of what you see?

        1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @bwisely
          last edited by PeterJones

          @bwisely,

          According to Microsoft support forum, the VBA editor does not accept Unicode characters.

          When I typed “Hello, World” into Google Translate, I got:
          af33e796-5c96-4888-a48c-09c52c28433a-image.png

          I copy/pasted the “Chinese (Traditional)” results “你好世界。” into the Excel VBA editor, I just get:

          Sub lookeehere()
              a = "?????"
          End Sub
          

          2e0f9d92-c35f-4e31-84bc-f5f81e87a90b-image.png

          (Reading that MS forum post suggests to me that maybe you are getting the characters from Excel itself, not from the VBA editor like your question implies. Or maybe you’re in the debugger, and grabbed a value from the local watch window, rather than from the VBA editor itself; I haven’t tried to see if that works.)

          If I paste that same text from Google Translate into a cell in Excel, I see what I expect:
          b88541e0-16d5-4624-bb78-325356dfa0b8-image.png

          If I re-copy that cell from Excel and paste it into Notepad++:

          你好世界。
          

          the glyphs show up just like they did in Google Translate:
          e2feeb0b-21eb-4a51-b0ce-066abab39ddc-image.png

          So, I could not replicate the exact circumstances of your problem statement, which doesn’t seem to match the capabilities of VBA editor; and when I replicated the only meaningful alternative I could think of, Notepad++ worked exactly as expected.

          Things that you can check on your end:

          1. Does your selected font have those Chinese (Traditional) glyphs available? (Settings > Style Configurator > Global Styles > Default Style > Font Style > Font Name, and compare that to the Windows Run > charmap.exe, select the font , and make sure that it has the glyphs you are trying to work with) 9c369245-3d3a-4eb4-9ac5-dc31f979305b-image.png
          2. Maybe try toggling Settings > Preferences > MISC > Use DirectWrite : having that checkmarked/on often helps users who are having trouble displaying the more complicated Unicode glyphs. (If it was off and you checkmark it, you will have to restart Notepad++ for it to take effect.)
            6bbec004-7cf0-4d39-b41d-2be6c22673ae-image.png
          1 Reply Last reply Reply Quote 4
          • PeterJonesP PeterJones referenced this topic on
          • PeterJonesP PeterJones referenced this topic on
          • bwiselyB
            bwisely
            last edited by

            thanks your help for the deltail.
            copy the raw data from exvel VBA or notepad++ copy and paste into excel vba are same problems.

            I will try to via MS notepad to notepad++ to solve this problem.

            thanks

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors