المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : تخفيض مستوى أمان الايكسل


ثامر أبو بلقيس
16-11-2014, 12:01 AM
السلام عليكم ورحمة الله وبركاته

لديك مشروع يتضمن ملفات ايكسل بها وحدات ماكرو

بدل أن تطلب من مستخدمي برنامجك بإخفاظ مستوى الامان كي تعمل الملفات بدون
إجراء العملية يدويا

نزرع الكود التالي عند دخول التجميعية في الحدث on startup
دون أن ننسى أن نجعل برنامجك مسؤولا اذ كان موجه لوينداوز أرقى من الـ xp
--abou_belkiss...2010 Security EXCEL2003
Registry.SetValue(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Office\\11.0\\Excel\\Security","Level","1",REG_DWORD);
--abou_belkiss...2010 Security EXCEL2010
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security","DataConnectionWarnings","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security","AccessVBOM","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security","VBAWarnings","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security","","",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location0","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location0","Path","C:\\Program Files\\Microsoft Office\\Office12\\XLSTART\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location0","Description","3",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location1","Path","%APPDATA%\\Microsoft\\Excel\\XLSTART",REG_EXPAND_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location1","Description","4",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location2","Path","%APPDATA%\\Microsoft\\Templates",REG_EXPAND_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location2","Description","5",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location3","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location3","Path","C:\\Program Files\\Microsoft Office\\Templates\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location3","Description","6",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location4","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location4","Path","C:\\Program Files\\Microsoft Office\\Office12\\STARTUP\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location4","Description","7",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location5","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location5","Path","C:\\Program Files\\Microsoft Office\\Office12\\Library\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\14.0\\Excel\\Security \\Trusted Locations\\Location5","Description","12",REG_SZ);
--abou_belkiss...2010 Security EXCEL2007
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security","DataConnectionWarnings","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security","AccessVBOM","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security","VBAWarnings","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security","","",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location0","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location0","Path","C:\\Program Files\\Microsoft Office\\Office12\\XLSTART\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location0","Description","3",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location1","Path","%APPDATA%\\Microsoft\\Excel\\XLSTART",REG_EXPAND_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location1","Description","4",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location2","Path","%APPDATA%\\Microsoft\\Templates",REG_EXPAND_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location2","Description","5",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location3","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location3","Path","C:\\Program Files\\Microsoft Office\\Templates\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location3","Description","6",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location4","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location4","Path","C:\\Program Files\\Microsoft Office\\Office12\\STARTUP\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location4","Description","7",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location5","AllowSubFolders","1",REG_DWORD);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location5","Path","C:\\Program Files\\Microsoft Office\\Office12\\Library\\",REG_SZ);
Registry.SetValue(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Office\\12.0\\Excel\\Security \\Trusted Locations\\Location5","Description","12",REG_SZ);
-------------
windows = Window.EnumerateTitles();
window_name = "Program Manager";
for handle, title in pairs (windows) do
result = String.Find(title, window_name, 1, false);
if (result ~= -1) then
Window.Close(handle, CLOSEWND_TERMINATE);
end
end

ستلاحظ عند دخول التجميعية إجراء عملية تحديث موضوعة قصدا
حتى يتم تخفيض مستوى الامان مباشرة

موفق أخي :abc_138:

abohmam
16-11-2014, 01:11 AM
جزاك الله خيرا أخانا ابا بلقيس

دائما تأتينا بالفوائد

بارك الله في جهودك

أبو صخر
17-11-2014, 03:45 PM
شـكــ وبارك الله فيك ـــرا لك ... لك مني أجمل تحية .

أبو يوسف
18-11-2014, 06:47 PM
بارك الله فيك اخانا أبا بلقيس

ثامر أبو بلقيس
21-11-2014, 01:25 PM
شكرا لكم على هذا المرور الطيب :abc_139:
:abc_138: :abc_138: :abc_138:

أبو فارس
23-11-2014, 05:43 PM
بارك الله فيك ونفع بك .. موفق بإذن الله ... لك مني أجمل تحية .

ثامر أبو بلقيس
16-12-2014, 01:44 PM
مرور عطر :abc_138: