انتقل إلى المحتوى الرئيسي

كيفية تحويل عناوين URL للصور إلى صور فعلية في Excel؟

doc url إلى img 1

إذا كانت لديك قائمة بعناوين URL للصور في العمود A ، والآن ، فأنت تريد تنزيل الصور المقابلة من عناوين URL وعرضها في العمود المجاور B كما هو موضح في لقطة الشاشة اليسرى. في Excel ، كيف يمكنك استخراج الصور الفعلية من عناوين URL للصور بسرعة وسهولة؟

تحويل عناوين URL للصور إلى صور فعلية برمز VBA

قم بتحويل عناوين URL للصور إلى صور فعلية باستخدام Kutools for Excel


تحويل عناوين URL للصور إلى صور فعلية برمز VBA

يمكن أن يساعدك رمز VBA التالي في استخراج الصور الفعلية بسرعة من عناوين URL للصورة ، يرجى القيام بذلك على النحو التالي:

1. اضغط باستمرار على ALT + F11 مفاتيح لفتح نافذة ميكروسوفت فيسوال باسيك للتطبيقات.

2. انقر إدراج > وحدة، والصق التعليمة البرمجية التالية في نافذة الوحدة النمطية.

كود فبا: تحويل عناوين URL للصور إلى صور فعلية:

Sub URLPictureInsert()
Dim Pshp As Shape
Dim xRg As Range
Dim xCol As Long
On Error Resume Next
Application.ScreenUpdating = False
Set Rng = ActiveSheet.Range("A2:A5")
For Each cell In Rng
filenam = cell
ActiveSheet.Pictures.Insert(filenam).Select
Set Pshp = Selection.ShapeRange.Item(1)
If Pshp Is Nothing Then GoTo lab
xCol = cell.Column + 1
Set xRg = Cells(cell.Row, xCol)
With Pshp
.LockAspectRatio = msoFalse
If .Width > xRg.Width Then .Width = xRg.Width * 2 / 3
If .Height > xRg.Height Then .Height = xRg.Height * 2 / 3
.Top = xRg.Top + (xRg.Height - .Height) / 2
.Left = xRg.Left + (xRg.Width - .Width) / 2
End With
lab:
Set Pshp = Nothing
Range("A2").Select
Next
Application.ScreenUpdating = True
End Sub

الملاحظات: 

  • 1. في الكود أعلاه ، A2: A5 هو نطاق الخلايا الذي يحتوي على عناوين URL التي تريد استخراج الصور منها ، يجب عليك تغيير مراجع الخلية حسب حاجتك.
  • 2. باستخدام هذا الكود ، لا يمكنك تحديد حجم الصور المستخرجة حسب حاجتك.
  • 3. يمكن للكود أعلاه فقط استخراج الصور الفعالة في الخلايا بجانب عمود عنوان URL الخاص بك ، ولا يمكنك تحديد خلية لإخراج الصور.
  • 4. يجب أن يكون لديك بعض المعرفة الأساسية بالرمز ، في حالة فقد أي حرف أو عدم صحة أي حرف ، فلن يتم تنفيذ الكود بنجاح.

3. ثم اضغط F5 المفتاح لتشغيل هذا الرمز ، وتم استخراج جميع الصور المقابلة من عناوين URL للصورة إلى العمود المجاور مرة واحدة ، وسيتم وضع الصور في وسط الخلايا المحددة ، انظر لقطة الشاشة:

doc url إلى img 2


قم بتحويل عناوين URL للصور إلى صور فعلية باستخدام Kutools for Excel

إذا لم تكن على دراية برمز VBA أو تريد معالجة قيود الكود أعلاه ، كوتولس ل إكسيل's مسار نموذج إدراج الصور (URL) يمكن أن تساعدك الميزة على إدراج الصور المتجاوبة بسرعة استنادًا إلى عناوين URL أو مسار محدد في جهاز الكمبيوتر الخاص بك كما هو موضح أدناه لقطة الشاشة. انقر لتنزيل Kutools for Excel!

ملاحظات:لتطبيق هذا مسار نموذج إدراج الصور (URL)أولاً ، يجب عليك تنزيل ملف كوتولس ل إكسيل، ثم قم بتطبيق الميزة بسرعة وسهولة.

بعد تثبيت كوتولس ل إكسيل، يرجى القيام بذلك على النحو التالي:

1. انقر كوتولس > إدراج > مسار نموذج إدراج الصور (URL)، في مربع الحوار المنبثق ، يرجى ضبط العمليات التالية ، انظر لقطات الشاشة:

doc url إلى img 3 doc url إلى img 4

2. ثم اضغط Ok الزر ، وسيتم استخراج الصور من عناوين URL ، انظر لقطة الشاشة:

doc url إلى img 1

انقر للتنزيل والإصدار التجريبي المجاني Kutools for Excel الآن!

أفضل أدوات إنتاجية المكتب

🤖 مساعد Kutools AI: إحداث ثورة في تحليل البيانات على أساس: التنفيذ الذكي   |  إنشاء التعليمات البرمجية  |  إنشاء صيغ مخصصة  |  تحليل البيانات وإنشاء الرسوم البيانية  |  استدعاء وظائف Kutools...
الميزات الشعبية: البحث عن التكرارات أو تمييزها أو تحديدها   |  حذف الصفوف الفارغة   |  دمج الأعمدة أو الخلايا دون فقدان البيانات   |   جولة بدون صيغة 
سوبر بحث: معايير متعددة VLookup    VLookup ذات القيمة المتعددة  |   VLookup عبر أوراق متعددة   |   بحث غامض ....
قائمة منسدلة متقدمة: إنشاء القائمة المنسدلة بسرعة   |  القائمة المنسدلة التابعة   |  قائمة منسدلة متعددة التحديد ....
مدير العمود: إضافة عدد محدد من الأعمدة  |  نقل الأعمدة  |  تبديل حالة رؤية الأعمدة المخفية  |  مقارنة النطاقات والأعمدة 
الميزات المميزة: التركيز على الشبكة   |  عرض تصميم   |   شريط الفورمولا الكبير    مدير المصنفات والأوراق   |  مكتبة الموارد (النص السيارات)   |  منتقي التاريخ   |  اجمع أوراق العمل   |  تشفير/فك تشفير الخلايا    إرسال رسائل البريد الإلكتروني عن طريق القائمة   |  سوبر تصفية   |   مرشح خاص (تصفية غامق / مائل / يتوسطه خط ...) ...
أفضل 15 مجموعة أدوات12 نص الأدوات (إضافة نص, إزالة الأحرف، ...)   |   +50 رسم الأنواع (مخطط جانت، ...)   |   40+ عملي الصيغ (احسب العمر على أساس تاريخ الميلاد، ...)   |   19 إدخال الأدوات (أدخل رمز الاستجابة السريعة, إدراج صورة من المسار، ...)   |   12 تحويل الأدوات (أرقام إلى كلمات, نتيجة تحويل عملة، ...)   |   7 دمج وتقسيم الأدوات (الجمع بين الصفوف المتقدمة, تقسيم الخلايا، ...)   |   ... و اكثر

عزز مهاراتك في Excel باستخدام Kutools for Excel، واختبر كفاءة لم يسبق لها مثيل. يقدم Kutools for Excel أكثر من 300 ميزة متقدمة لتعزيز الإنتاجية وتوفير الوقت.  انقر هنا للحصول على الميزة التي تحتاجها أكثر...

الوصف


يجلب Office Tab الواجهة المبوبة إلى Office ، ويجعل عملك أسهل بكثير

  • تمكين التحرير والقراءة المبوبة في Word و Excel و PowerPointوالناشر والوصول و Visio والمشروع.
  • فتح وإنشاء مستندات متعددة في علامات تبويب جديدة من نفس النافذة ، بدلاً من النوافذ الجديدة.
  • يزيد من إنتاجيتك بنسبة 50٪ ، ويقلل مئات النقرات بالماوس كل يوم!
Comments (61)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
can anyone help to extract mutiple links folllowed by comma  in one cell 
This comment was minimized by the moderator on the site
I own Kutools and I cannot seem to get this function to work properly. After I run it based on the examples above I get a message that says "1 picture(s) failed to be inserted"
Its not an htpps address. And the link the works fine when clicking from excel.
Please help
This comment was minimized by the moderator on the site
I have the same problem now. It worked very well yesterday, but today it's just not working :(
This comment was minimized by the moderator on the site
If I want the image to resize with the cell, is it as simple as changing this line to "msoTrue"?.LockAspectRatio = msoFalse


This comment was minimized by the moderator on the site
When I renew it takes the same picture again
So it adds images on top of each other
how can i prevent this?
Do not add the added picture again ?how can I do?
edit: also pictures are not loading when we open later?
This comment was minimized by the moderator on the site
When I renew it takes the same picture againSo it adds images on top of each other
how can i prevent this?
Do not add the added picture again ?how can I do?
This comment was minimized by the moderator on the site
thank you for VBA code, i able to get the url images as picture
but, after file closed, and then i opened it again, picture missing.
how to solve this problem?
This comment was minimized by the moderator on the site
Hello, Robby,After copying and pasting the code, when you close the workbook, you should save the file as Excel Macro-Enabled Workbook format for saving the code.When reopen the workbook, you should click the Enable Content button from the yellow ribbon at the top of the workbook.Please try, thank you!
This comment was minimized by the moderator on the site
thank you for fast response
I have save as Excel Enable Workbook and also Enable Content, and Picture will be shown up if i connected to internet, but when offline mode, the picture will be missing, Excel message : Picture can't be display
is there any solution so the picture will still shown up even though i am in offline mode (no internet available)
This comment was minimized by the moderator on the site
Hi, Robby, In this case, if you are in offline mode, I recommend you to use the Insert Pictures form Path(URL) feature of Kutools for Excel, you can download the Kutools and use it 30 days for free trail. After inserting the pictures, the pictures will be saved into the workbook.Please try.
This comment was minimized by the moderator on the site
What image types does this work with? I have mostly svg files and those are not working, but png and jpeg are fine.
This comment was minimized by the moderator on the site
Hello, travwoody,Yes, as you said, the code does not work for the svg files.Or can you insert a picture url here? We can test your image url for modifying the code.Thank you!
This comment was minimized by the moderator on the site
Why this line is not working for me?
Set Pshp = Selection.ShapeRange.Item(1)
Pshp object is becoming nothing, even though I have a valid image URL
This comment was minimized by the moderator on the site
I will also specify that I am writing about the VBA script
This comment was minimized by the moderator on the site
This code works great. Thank you!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations