Trang thông tin tổng hợp
Trang thông tin tổng hợp
  • Tranh Tô Màu
  • Meme
  • Avatar
  • Hình Nền
  • Ảnh Hoa
  • Ảnh Chibi
  • Ảnh Nail
Tranh Tô Màu Meme Avatar Hình Nền Ảnh Hoa Ảnh Chibi Ảnh Nail
  1. Trang chủ
  2. Ảnh tổng hợp
Mục Lục

PowerPoint COM Interop

avatar
Xuka
03:01 16/11/2025

Mục Lục

@supermanPunch and @Manish540 Thank you for responding so quickly. Please see full VB.NET below. The only other activities in this particular .xaml are assign activities for local folders (which are definitely correct).

Dim arr_Metrics(0 To 3, 0 To 3) As String 'Define array of public variables Dim excel As Microsoft.Office.Interop.Excel.Application Dim wb_InputReport As Microsoft.Office.Interop.Excel.Workbook Dim ws_Metrics As Microsoft.Office.Interop.Excel.Worksheet 'Dim excel stuff Dim I As Integer, J As Integer Dim ppt_App As Microsoft.Office.Interop.PowerPoint.Application, ppt_Pres As Microsoft.Office.Interop.PowerPoint.Presentation, ppt_Slide As Microsoft.Office.Interop.PowerPoint.Slide 'Dim ppt stuff Dim filepath_PPT As String, filename_PPT As String Dim wkb As Microsoft.Office.Interop.Excel.Workbook Dim AlreadyOpen_Excel As Boolean Dim ppt As Microsoft.Office.Interop.PowerPoint.Presentation Dim AlreadyOpen_PPT As Boolean

'Check Excel Open On Error Resume Next wkb = excel.Workbooks(strInputReport) AlreadyOpen_Excel = Not wkb Is Nothing wkb = Nothing

'Check PPT Open On Error Resume Next ppt = ppt_App.Presentations(strSlide) AlreadyOpen_PPT = Not ppt Is Nothing ppt = Nothing

'Check if wb is already open then Set Excel references If AlreadyOpen_Excel Then wb_InputReport = excel.Workbooks(strInputReport) Else wb_InputReport = excel.Workbooks.Open(Filename:=strInputReport) End If

ws_Metrics = CType(wb_InputReport.Worksheets(“Metrics”),Microsoft.Office.Interop.Excel.Worksheet)

'1st Column arr_Metrics(0, 0) = Math.Round((CDbl(ws_Metrics.Range(“D5”).Value) * 100), 2) & “%” arr_Metrics(1, 0) = Math.Round((CDbl(ws_Metrics.Range(“D6”).Value) * 100), 2) & “%” arr_Metrics(2, 0) = Math.Round((CDbl(ws_Metrics.Range(“D7”).Value) * 100), 2) & “%” arr_Metrics(3, 0) = Math.Round((CDbl(ws_Metrics.Range(“D9”).Value) * 100), 2) & “%”

'2nd Column arr_Metrics(0, 1) = CStr(ws_Metrics.Range(“E5”)) arr_Metrics(1, 1) = CStr(ws_Metrics.Range(“E6”)) arr_Metrics(2, 1) = CStr(ws_Metrics.Range(“E7”)) arr_Metrics(3, 1) = CStr(ws_Metrics.Range(“E8”))

'3rd Column arr_Metrics(0, 2) = CStr(ws_Metrics.Range(“F5”)) arr_Metrics(1, 2) = CStr(ws_Metrics.Range(“F6”)) arr_Metrics(2, 2) = CStr(ws_Metrics.Range(“F7”)) arr_Metrics(3, 2) = CStr(ws_Metrics.Range(“F8”))

'4th Column arr_Metrics(0, 3) = CStr(ws_Metrics.Range(“G5”)) arr_Metrics(1, 3) = CStr(ws_Metrics.Range(“G6”)) arr_Metrics(2, 3) = CStr(ws_Metrics.Range(“G7”)) arr_Metrics(3, 3) = CStr(ws_Metrics.Range(“G8”))

'Check if open and Reference presentation If AlreadyOpen_PPT Then ppt_Pres = ppt_App.Presentations(filename_PPT) Else ppt_Pres = ppt_App.Presentations.Open(filepath_PPT & filename_PPT) End If

'Save as new document ppt_Pres.SaveAs (filepath_PPT & “TEST PPT OUTPUT”)

'Define slide ppt_Slide = ppt_Pres.Slides(1)

For I = 1 To 4 For J = 1 To 4 ppt_Slide.Shapes(“shp_” & I & “-” & J).TextEffect.Text = arr_Metrics(I, J) Next J Next I

'Save/Close Presentation and Kill ppt application 'With ppt_Pres ’ .Save ’ .Close 'End With ppt_Pres.Save ppt_Pres.Close

ppt_App.Quit

0 Thích
Chia sẻ
  • Chia sẻ Facebook
  • Chia sẻ Twitter
  • Chia sẻ Zalo
  • Chia sẻ Pinterest
In
  • Điều khoản sử dụng
  • Chính sách bảo mật
  • Cookies
  • RSS
  • Điều khoản sử dụng
  • Chính sách bảo mật
  • Cookies
  • RSS

Trang thông tin tổng hợp stt

Website stt là blog chia sẻ vui về đời sống ở nhiều chủ đề khác nhau giúp cho mọi người dễ dàng cập nhật kiến thức. Đặc biệt có tiêu điểm quan trọng cho các bạn trẻ hiện nay.

© 2025 - STT

Kết nối với STT

https://xemthoitiet.com.vn/ https://xemlicham.edu.vn
Trang thông tin tổng hợp
  • Trang chủ
  • Tranh Tô Màu
  • Meme
  • Avatar
  • Hình Nền
  • Ảnh Hoa
  • Ảnh Chibi
  • Ảnh Nail
Đăng ký / Đăng nhập
Quên mật khẩu?
Chưa có tài khoản? Đăng ký