- ©«¤l
- 43
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 75
- ÂI¦W
- 0
- §@·~¨t²Î
- windows 7
- ³nÅ骩¥»
- office 2007
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2014-5-6
- ³Ì«áµn¿ý
- 2019-6-17
|
[µo°Ý] ½Ð°Ý¦U¦ì«e½úÃö©ó±Nexcel ¹Ïªí©ñ¸m¨ìpptÀɤ¤(¶}±Ò)°ÝÃDnew
¤£¦n·N«ä¡B½Ð«e½úÌÀ°¦£¤@¤U¡G
¥H¤Uµ{¦¡¥Dn¬°±N¥~³¡¸ê®Æ¤¤ªºexcel¹ÏÀÉ©ñ¸m¨ì«ü©w¦aÂIªºpptÀɤ¤¨Ã·s¼W¤Û¿O¤ù¡A
¦ý¤p§Ì¹Á¸Õ¹L¥d¦íªº°ÝÃDÂI¦n¹³¦b©ó[Set wb(2) = Workbooks.Open(Worksheets("¸ô®|°Ï").Cells(3, 3) & "\" & Worksheets("¸ô®|°Ï").Cells(3, 2))]¡A
³o¤@Óexcel¶}±Ò«á´N·|¥X²{{°}¦C¯Á¤Þ¶W¥X½d³ò}¡A¯à¤£¯à½ÐÀ°¦£¤p§Ì¬Ý¤@¤U¥H¤Uªºµ{¦¡½X»Ýn¦A¥[¤°»ò¤U¥h¶Ü¡H
ªþ¥ó¡G
PPT´ú¸Õ1.rar (39.92 KB)
ÁY¼gµ{¦¡½X¡G (ªþ¥ó¬°¨ä¥¦°Ê§@ªºµ{¦¡¡B¦ý¦ü¥G¤£¼vÅT°ÝÃDÂI)
Sub excel¥~³¡¸ê®Æ»s¦¨pptÀÉ()
Dim wb(1 To 2) As Workbook, SN As String, SNN As Integer
Dim Customer As String '®Æ¸¹ªºÅܼƦWºÙ
'°ÝÃDÂI=================================
Set wb(1) = ThisWorkbook
Set wb(2) = Workbooks.Open(Worksheets("¸ô®|°Ï").Cells(3, 3) & "\" & Worksheets("¸ô®|°Ï").Cells(3, 2))
'°ÝÃDÂI=================================
'For this example click References on the Tools Menu, and select the (¦b³oÓ¨Ò¤l¤¤³æÀ»¤u¨ãµæ³æ¤Wªº¤Þ¥Î¡AµM«á¿ï¾Ü)
'Microsoft Powerpoint 9.0 object libraries.
Dim Ppt As Object, pres As Object
Dim SlideTitle As String
'Create a Microsoft PowerPoint session(³Ð«Ø¤@ÓMicrosoft PowerPointºt¥Ü·|ij)
Set Ppt = CreateObject("powerpoint.application")
'Make PowerPoint visible(ÅýPowerPoint¤¤¥i¨£)
Ppt.Visible = True
'Activate PowerPoint (±Ò°ÊPowerPoint¤¤)
AppActivate Ppt.Name
'Open a new document in Microsoft PowerPoint(¥´¶}Microsoft PowerPoint¤¤¤@Ó·sªº¤åÀÉ)
' Set pres = Ppt.Presentations.Add
Set pres = Ppt.Presentations.Open(Worksheets("¸ô®|°Ï").Cells(2, 3) & "\" & Worksheets("¸ô®|°Ï").Cells(2, 2)) '¶}±ÒpptÀɪº¸ô®|
Dim activeSlide As PowerPoint.Slide
Dim cht As Excel.ChartObject
'Loop through each chart in the Excel worksheet and paste them into the PowerPoint
'(³q¹L¦b¨CӱƦæº]¤¤ªºExcel¤u§@ªí¡A¨Ã´`Àô±N¥¦ÌÖß¶K¨ìPowerPoint¤¤)
cd = 1 '³]©w¬°»Ý§ó·sªº¸ê®Æªì©lÄæ¦ì
Do
cd = cd + 1
Customer = wb(1).Worksheets("¤À¶²M³æ").Cells(cd, 1).Value
For Each cht In wb(2).Worksheets(Customer).ChartObjects
'´ú¸Õ¤¤----------------------------------
' 'Add a new slide where we will paste the chart(²K¥[·sªº¤Û¿O¤ù¡A§Ú̱NÖß¶K¹Ïªí)
' 'ppLayout«¬ºA¦³..ppLayoutTitleOnly¡BppLayoutText¡BppLayoutText¡BppLayoutChart¡BppLayoutTitle(µe±³Ì«e¥D¶«Ê±)
'
Ppt.ActivePresentation.Slides.Add Ppt.ActivePresentation.Slides.Count + 1, ppLayoutTitleOnly
Ppt.ActiveWindow.View.GotoSlide Ppt.ActivePresentation.Slides.Count
Set activeSlide = Ppt.ActivePresentation.Slides(Ppt.ActivePresentation.Slides.Count)
Next
Loop Until cd >= wb(1).Worksheets("¤À¶²M³æ").[a65536].End(3).Row
AppActivate ("Microsoft PowerPoint")
Set activeSlide = Nothing
Set Ppt = Nothing
'test-----------------------------------------------------------
Set pres = Nothing
wb(2).Close True
Set wb(1) = Nothing
Set wb(2) = Nothing |
|