conghoangxd037
Thành viên chính thức


- Tham gia
- 16/1/13
- Bài viết
- 54
- Được thích
- 2
1. Hiện tại em có 1 đoạn code sau khi chèn ảnh vào trong excel rồi em xóa các hình đã chèn ngoài máy tính lưu file excel lại thì khi mở lại excel không hiện hình được.Excel báo lỗi (the linked image cannot be displayed.....) Đoan code của em như sau:
Dim xlApp As Object = GetObject(, "Excel.Application")
Dim xlWorkSheet1 As Object = xlApp.Worksheets("Sheet1")
Dim xlRange1 As Object = Nothing
With xlWorkSheet1.Pictures.insert("D:\1.png")
.Left = xlRange1.Left
.Top = xlRange1.Top
.Placement = 1
.PrintObject = True
End With
xlWorkBook.Save()
xlWorkBook.Close()
xlApp.Quit()
Dim xlApp As Object = GetObject(, "Excel.Application")
Dim xlWorkSheet1 As Object = xlApp.Worksheets("Sheet1")
Dim xlRange1 As Object = Nothing
With xlWorkSheet1.Pictures.insert("D:\1.png")
.Left = xlRange1.Left
.Top = xlRange1.Top
.Placement = 1
.PrintObject = True
End With
xlWorkBook.Save()
xlWorkBook.Close()
xlApp.Quit()