How yo Kill File Path has Unsupported Language ?

Dossfm0q

Banned User
Joined
Mar 9, 2009
Messages
570
Office Version
  1. 2019
Platform
  1. Windows
Greetings
How to VBA read "C:\Users\User\desktop\ملف عربي.xlsx"

it converts "ملف عربي" to "??? ????"

Sub KillFile()

dim FilePath as string
FilePath= "C:\Users\User\desktop\ملف عربي.xlsx"
Kill FilePath

end sub

Code:
Sub KillFile()


Dim FilePath As String
FilePath = "C:\Users\User\desktop\[B][COLOR=#ff0000]??? ????[/COLOR][/B].xlsx"
Kill FilePath




End Sub

THX
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
What's your default language? Do you want to delete only files whose name contains this particular language or you have many files in this language but you only want to delete some, but not all, of them? Do you have files in other non-ASCII language (you have file names in several different languages)?
 
Upvote 0
@Dossfm0q

The VB Editor doesn't support unicode characters so you will first need to change the language for non-unicode programs as follows :

1- Go to Control Panel
2- Administrative Tab
3- Change System Locale
4- Select the language (Arabic in your case)
5-Reboot your computer for the new settings to take effect.
6- In the VBA Editor,go to Tools>Options>Editor Format> and choose Arabic font

Now you should be able to use code like this :
Code:
Sub Test()
    Dim sFilePathName As String
    sFilePathName = "[COLOR=#333333]C:\Users\User\desktop\[/COLOR][B][COLOR=#ff0000]ملف عربي[/COLOR][/B].xlsx"
    If Len(Dir(sFilePathName)) Then Kill sFilePathName
End Sub
 
Last edited:
Upvote 0
Writing Code in Arabic into VBA Project works very well

But after test I have Err which highlighted in Yellow, when mouse go over highlighted line appear Error
s!AuVczTBE49WklkpwAXh71ui0871c


s!AuVczTBE49WklkpwAXh71ui0871c
s!AuVczTBE49WklkpwAXh71ui0871c

https://1drv.ms/f/s!AuVczTBE49WklkpwAXh71ui0871c
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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