Automate PowerPoint Presentation using VBA. Excel PowerPoint Integration

Automate PowerPoint Presentation using VBA. Excel PowerPoint Integration Hey guys welcome back to another video from VBA A to Z I'm non-pom I and in this video we'll create a project to update PowerPoint presentation using Excel data in nutshell this video will.

Automate PowerPoint Presentation using VBA. Excel PowerPoint Integration

Show you how to integrate Excel and PowerPoint using VBA activate objects control or position objects as needed in the following videos we'll also cover more videos on how to export PowerPoint.

Slides the images or video in full HD or other resolutions as always protect files and source codes are free for download and use the only request from you is to support my channel so I can.

Keep sharing all this useful video so before we begin please do not forget to subscribe and hit the bell icon for upcoming videos let us first take a quick look at the files that we'll be.

Using for this project the idea here is to prepare the visualization and the data all the preparation work within Excel and export them to PowerPoint using VBA and then we're going to use.

Vvd to position them manipulate the size and objects you can achieve this by linking them to excel as well but it's going to be painful to maintain them and resolve issues that could arise from.

Versioning of your excel okay so we're gonna create a small project here to export excel range the PowerPoint first we're gonna create a small user interface in Excel and then we're gonna.

Start writing the code after loading up my excel and we'll create it you know like a simple user interface so here we will have excel template this is gonna have our pod for example a simple.

Interface that similar to the one we created the other day something like this so this will contain the Excel template from where the data is gonna be picked and then this is.

Gonna be the PowerPoint template something like this this will contain the paths we want to Suffolk area from the worksheet right so.

Will I have a small table to maintain this oh here we could have a button something like this call this export and here we can have a small table this could be the worksheet name and then.

Next we can have a range name we'll just call it range sheet range and then we want to have like we want to define the width and the height okay and then we can also define top and the left you.

Posts Related:

    Know we want to position it later so we

    Can have a small table like this so first is a dashboard from dashboard we want to pick up certain area let's name the range let's call this or call this.

    Range one we want to explore this range and the width the height we'll just leave it as it is for now I'm going to the timeline worksheet you.

    Here so that's gonna be all from the UI design before we can export the data we need to get you know like what should be the weight what should be the height how further you know like from the top.

    Or left we want to position these images that we are exporting okay so let's manually try one of them for example let's say that we want to export this range should be arranged one this one.

    Okay so I'll copy this manually I'm going to power plane for knowledge us to let this base special let's paste it as a bitmap okay so once you're here you can manually position in.

    The way you want maybe this further to you know eye towards the left and you can make it bigger like this okay so once you're happy we'll try to get this current.

    Position what is the left top and then the height and the width of this of this particular image so let's insert a new model that's quickly call this get position something like this okay here.

    We need to get a slide the shape and then the position okay so say team slide as slide and then the shape as hey this is just one time okay and then we'll declare a slide as this active.

    Presentation slide and then this is slide number two noticed a slight number to go to or we can say like this okay and then we'll just print this out in our immediate window.

    I print run this so it's basically

    Saying the top is 80 point this so maybe we'll just specify this as the top top is 80 and then the left is 20 the height diet is 435 and then the width is 919.

    Okay in a similar fashion we can you know like replicate it for now I'm just gonna use this same configuration but you can do this exercise for yourself I'm gonna save this code for you so that.

    You can get it later so this is one time activity you configure it in this fashion now we'll start writing the code to open this particular excel template refer to this.

    Particular table to get the configuration and then we're gonna export that particular range which is this ranges to the PowerPoint okay so it's called this Excel part and this.

    PowerPoint also I'm gonna go to and insert a new module we'll call this up export to powerpoint so before we can begin make sure your reference to the PowerPoint library like this okay let's.

    Start declaring our variables so first is the PowerPoint and then we have we need the slide and then we'll need the shape then we'll need workbook then we'll need yeah I think that's pretty.

    Much for now so we'll call this new PowerPoint presentation or sorry first we need it for application and then it's gonna be the presentation all we'll just call this as presentation this is gonna.

    Be that slide this will be the shape it's gonna be the workbook okay so first let's open the workbook so we'll call this okay the file name is.

    Gonna be this once we're done we want to close this without saving okay and then now we already have this PowerPoint you know I created now you want to open up this presentation.

    Okay so this is where we specify our or point but I think we have done setup wrongly so these two are flip should be like this.

    Okay so we'll open up the PowerPoint first and then let's first give it a try we'll specify or slide so the idea here is once we open this file the code is going to open this file and then it's.

    Going to loop through this particular range let's call this like this then we're going to look through this range yeah we'll call this s range so after we open this and open the PowerPoint we're.

    Going to look through so now we're looking through this particular range here okay now we have we can directly navigate to that particular sheet will activate the.

    Workbook and then this range value is gonna be our you know like the sheet name or we can just activate it like this there are various ways to do it but we're gonna keep it as simple as.

    Possible okay and then from here we're gonna get copy the range which is this yeah I think we should set up more variables so I'll just copy all this like this.

    This will become more variable names okay let's make all of this a string uh no not all of them so this is gonna be we can make a double should be okay because.

    We might need to have a decimal points okay so our variables already the sheet name here is gonna be with this particular sheet from the sheet straighted the range is gonna be this.

    Particular whatever this particular range is located dot true okay and then the column is gonna be this is gonna be five one two three four five right so just gonna be the value from there okay.

    Like this next is the width the height top left so we can keep this consistent as well like this gonna be the fourth six seven eight and nine okay so four five six seven eight nine.

    Okay so the name of the sheet the width range with height top and left okay so now we have this variable set up we can we have to specify because we have multiple workbooks now we best hopefully.

    This will this should work okay now we have a variable setup let's navigate to the Excel this Excel workbook template and then from here we want to activate first go to the required worksheet okay.

    So for now I'm not gonna open up the PowerPoint I'll just leave it as this well first test out this excel thing and then we'll call them export range pass range.

    Okay so this work we're gonna copy and then we'll start you know like writing some code for the PowerPoint okay so let's first try this I'm going to close this file save it because we've created.

    Some name range there we want to use that okay just give me one second there's some problem here okay and then I'm gonna close the PowerPoint as well let's declare two.

    More variables so admin sheet and then we're gonna call this configuration this particular range will call this as config range like this and we're gonna set this up the is gonna be this.

    And this range let's put it in this fashion it's my bad okay I'm gonna try and run this now we'll have to turn off the display alerts if you look at our window.

    So she our variables have been set up here like this okay no it's kind of cool let's say that the worker has this activated and then it's gonna activate this ocular sheet and.

    Then setting the range is gonna copy the range so now it seems to be working I'm gonna write it's no code here to explore it okay going to the next one go to the next.

    Sheet copy okay it's clear the clipboard so here I'm gonna write a code to export it to PowerPoint so we already copied the range now we'll set up our slides as.

    DISCLAIMER: In this description contains affiliate links, which means that if you click on one of the product links, I'll receive a small commission. This helps support the channel and allows us to continuetomake videos like this. All Content Responsibility lies with the Channel Producer. For Download, see The Author's channel. The content of this Post was transcribed from the Channel: https://www.youtube.com/watch?v=dIqoXYy_Clg
Previous Post Next Post