Home > Software engineering >  Excel and powerpoint interaction problem
Excel and powerpoint interaction problem

Time:09-16

Have an open PPT and excel; I need to do a macro in excel, PPT in one page (slide) copied to excel A1 cell;

Have not been able to realize the copy operation, has a master to help it is under the guidance of;

For the first time ~

CodePudding user response:

Recording a macro, and then look at the code generated for you, as written,

CodePudding user response:

refer to the second floor of guiyang horse Ma Shanfu plugging waterproof engineering professional maintenance of swimming pool response:
to record a macro, and then look at the code generated for you, according to write that the
PPT can't record macro, recorded in the excel macro can't seem to identify excel operation

CodePudding user response:

 Sub demo () 
Dim app As Object
Set the app=CreateObject (" powerpoint. Application ")
With app. Presentations. Open (" C: \ Users \ star meteor, wings of maple \ Desktop \ presentation 1. PPTM ")
Slides TAB (2). The second page Copy Copy 'choose slide
ActiveSheet. Paste
The Close
End With
App. Quit
End Sub

CodePudding user response:

That is the PPT file copy and paste
This is in accordance with the requirements of the building Lord
 Sub demo () 
Dim app As Object
Set the app=CreateObject (" powerpoint. Application ")
App. Presentations (1). Slides TAB (2) Copy 'choice to open the first slide the second page of the Copy of
ActiveSheet. Cells (1, 9). Select
ActiveSheet. Paste
End Sub
  •  Tags:  
  • VBA
  • Related