Home > Software engineering >  [for] use VBA in Excel in multiple worksheet copy form to PPT, met the Range () fails
[for] use VBA in Excel in multiple worksheet copy form to PPT, met the Range () fails

Time:11-16

Use VBA in Excel in multiple worksheet copy form to PPT, action is very simple, but in the Range (and fail - worksheet object), image & amp; The attached below
(actually I first place before the attempt is in red mark out of the question to add Dim xlSheet2 As Excel. The Worksheet and Set xlSheet2=xlBook. Worksheets (" X1ASIMajor1 "), but it will prompt: execution phase error 430, item category does not support AUTOMATION or expected interface)
Please help, thank you don't know where the problem is,
Quote:


Sub test ()

Dim xlApp As Excel. Application
Dim xlBook As Excel. The Workbook
Dim xlSheet1 As Excel Worksheet, xlSheet2 As Excel. The Worksheet
The Set xlApp=New Excel. Application
The Set xlBook=xlApp. Workbooks. Open (" C: \ Users \ z17073216 \ Desktop \ QE PPT Report Output \ Failure Summary_20190826151732 ")
The Set xlSheet1=xlBook. Worksheets (" X1ACQAMajor ")
The Set xlSheet2=xlBook. Worksheets (" X1ASIMajor1 ")

ActiveWindow. Selection. SlideRange. Shapes. AddTextbox (msoTextOrientationHorizontal, (12.7-10.4)/0.035 (9.5 8.35)/0.035 (12.3 + 10.5)/0.035, 0.035 (8.4 7.1)/). Select
ActiveWindow. Selection. TextRange. Text="X1A Quality Performance l 08/13 (05:00-05:00)"
ActiveWindow. Selection. TextRange. The Font. The Name="Arial"
ActiveWindow. Selection. TextRange. The Font. The Size=24
ActiveWindow. Selection. TextRange. ParagraphFormat. BaseLineAlignment=ppBaselineAlignCenter

XlSheet1. Range (" B2: L12). Copy
ActiveWindow. View. PasteSpecial ppPasteOLEObject
XlSheet1. Application. CutCopyMode=False
XlBook. Close True
ActiveWindow. Selection. SlideRange. Shapes (2). Top=(9.5 6.5)/0.035
ActiveWindow. Selection. SlideRange. Shapes (2) Left=11 (12.7 -) 0.035/

xlSheet2. Range (" B2: L12). Copy
ActiveWindow. View. PasteSpecial ppPasteOLEObject
XlSheet2. Application. CutCopyMode=False
XlBook. Close True
ActiveWindow. Selection. SlideRange. Shapes (3). The Top=(9.5 + 1)/0.035
ActiveWindow. Selection. SlideRange. Shapes (3) Left=11 (12.7 -) 0.035/
End Sub
  •  Tags:  
  • VBA
  • Related