Reillyand, Inc. |
|
|
Office Integration Programming Each MS Office application has strengths in different areas. Rather than forcing an application to do something that can be more easily accomplished in another application, it is wise to use VBA programming to control another application from the primary application and let each application do what it does best. In general, it really doesn't matter which application controls the other applications since each Office application can control any other Office application. But there are some significant advantages in wisely choosing which is the controlling application. For example, if PowerPoint is going to be used as a screenshow and you want to collect information from the audience at a trade show, you would want to let PowerPoint control either Excel or Access to store the information obtained. On the other hand, if you were using Excel to create lots of charts and tables from an Access database and assemble the result as a presentation or report, e.g. a marketing proposal, in PowerPoint you would then want Excel to control Access and Powerpoint. Get or Create Object
This routine either activates an open instance of Excel or, if no instance is open, it creates a new instance of Excel so that the code in PowerPoint can read and/or write data from the Excel workbook. The user can either see the Excel workbook on the screen or the workbook and the Excel application can be entirely invisible to the user. They will not even realize Excel is being controlled.
Get_Create_PowerPoint_Object_Visible() This is the most common use of controlling PowerPoint from another application, Excel in this case. This sample routine copies a sample chart from an Excel workbook to the clipboard and pastes it into a new file in PowerPoint that has been created. The user will see the PowerPoint application being opened and the chart being pasted into the presentation. The file is then saved and the PowerPoint application is then closed leaving you back in Excel.
Get_Create_PointPoint Object_Invisible() This example is a more advance technique of controlling PowerPoint from another Office application and controls PowerPoint entirely in memory and nothing is visible in PowerPoint on the screen. The advantage is that the execution time is dramatically faster than when PowerPoint is visible. The disadvantage is that the code must entirely use references to objects in PowerPoint and cannot use any selections of objects or pages. This can be more difficult for those new to programming in PowerPoint. But for working in extremely long applications such as creating long presentations or capturing each object of many presentations into a database the time savings can be well worth the discipline of entirely using references to PowerPoint objects and never selecting any object.
|
|
Send mail to brian@reillyand.com with
questions or comments about this web site.
|