VBA to Create Google Sheets Office

VBA to Create Google Sheets Office Now we will move on to google sheets um again google sheets is pretty much straightforward but i'll give a you know a detailed walkthrough so that you are able to.

Implement this easily for your project okay so once you click on code samples underscore sheets uh you'll be able to see all the sample codes for google sheets.

Follow the same approach first uh create the connection terminate the connection and then you can simply use this um object to create uh you know all the.

Methods associated with google sheets so let's first start by creating a new google sheet or a file um so this this method.

Simply call you know pass on the name of the file you want it to be so let's call this let's call this demo for now and let's run this.

So you'll see a demo file here has been created and then there automatically by default sheet one is added a tab name okay.

VBA to Create Google Sheets

Um now let's say that uh this example here demonstrates uh creating a new file called expense to and then um you don't always have to pause you know like the.

Methods in this way um the good thing about this is that you specify a variable and then you call a method so when it returns a value you can use that.

Uh to you know like to utilize it somewhere else um or to to track it or log it right so for example in this uh creates uh the.

Sheet um service and then uh it creates a new google sheet and then here it adds a new tab called data and then it deletes the tab call sheet1.

Yeah the default tab and then it terminates uh the file uh the service and then it initializes the drive service here in the same module so this way you can.

Combine all this together uh and then it create it uses this move object to um the new file that was created to um to a folder called x-men so let's try.

    This

    Uh i'll go to data uh we'll create a file by default the file is added to the main parent folder so we'll.

    Create a file and then move it to this expense data folder we'll call this expense data and then we'll add a new tab called.

    Data within this particular file and then we'll delete the default sheet and then we'll move this file to this folder okay so i'm gonna run this.

    So there's expense data there it got moved and if i go in here here's expense data and if i open this particular um file you'll see that the new tab has been.

    Added successfully and then uh the the the default tab has been deleted okay so this this is example of how you can combine um.

    Google drive uh matches as well as the sheet methods and then different ways to call it you can simply call it uh in this fashion as well if you don't.

    Want to pass it you know like x is equal to uh similar similar to this okay you can call in this question as well or you can directly call the method in.

    This fashion or uh with this particular object dot you know underscore this uh i mean dot add new method uh you can also directly call in this method if.

    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 continue to make 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=6T7drgdbyPY
Previous Post Next Post