ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý¦U¦ì«e½úÃö©ó±Nexcel ¹Ïªí©ñ¸m¨ìpptÀɤ¤(¶}±Ò)°ÝÃDnew

[µo°Ý] ½Ð°Ý¦U¦ì«e½úÃö©ó±Nexcel ¹Ïªí©ñ¸m¨ìpptÀɤ¤(¶}±Ò)°ÝÃDnew

¤£¦n·N«ä¡B½Ð«e½ú­ÌÀ°¦£¤@¤U¡G
¥H¤Uµ{¦¡¥D­n¬°±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

³Ìªñ¤]¦b¼g³o­Óµ{¦¡¡AÅv­­¤£¨¬¡A½Ð°Ý¥i¥H­É§Úµ{¦¡½X°Ñ¾\¶Ü?
[email protected]

TOP

¦^´_ 2# stillfish00


   ­ì¨ÓÁÙ¥i¥H³o¼Ë¡B·PÁÂstillfish00«e½úªºÀ°¦£®@~

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2015-4-22 10:33 ½s¿è

¦^´_ 1# ii31sakura
«ö°»¿ù¬O¥X²{¦b§ó¤U­±ªº¦a¤è¡C

Set pres = Ppt.Presentations.Open(wb(1).Worksheets("¸ô®|°Ï").Cells(2, 3) & "\" & wb(1).Worksheets("¸ô®|°Ï").Cells(2, 2)) '¶}±ÒpptÀɪº¸ô®|
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD