Posts

Power Automate - Automatically fetch data from Power BI in to Excel and Send the copy of the Excel file via Email

Image
Power Automate - Automatically fetch data from Power BI in to Excel and Send the copy of the Excel file via Email Step-1 Step-2 Step-3 Using Command text we can make changes in the data we fetch from the Power BI. Like add fields/columns, filter data, rename columns. It is a DAX formula. Step-4 Step-5      Step-6 Step-7 Posting message on Teams. We can post message to a Teams Group  also by selecting Group chat from Post in and select the Teams Group from the Group chat  dropdown that will appear after making selection. Step-8 Location:  We need to select the Group  on SharePoint in which our file is located. Document Library: We need to select the Documents option from the dropdown. File: Select the file on which you want to run the script. Script: Select the script to perform the desired action. Step-9 Step-10 Step-11 Using Filter Query  we can decide which file properties we want to get. We are performing this step to attach excel as an attach...

Blog Links

Power Query & Power BI https://learnpowertoolwithexcelsujeet.blogspot.com/ Power Query & Power BI https://learngaswithexcelsujeet.blogspot.com/

MySQL Useful Queries

Copy Headings from one table into other table: create table test2 like table1; Insert data from one table into other table: insert into table2 select * from table1 Find duplicate records in a table: SELECT * ,           ROW_NUMBER () OVER (               PARTITION BY emp_id, name, age, doj, dob  ) AS row_num FROM EmployeeTable; Note: Write all columns name in the table. This new row_num is not part of the table. Delete duplicate records in a table: To delete duplicate records we can use a CTE (Common Table Expression) with the ROW_NUMBER() function. Alter table layoffs_staging_2 add row_num int; ----------------------------------------------------------------------------------------------------------------------------- With CTE as ( SELECT *,        ROW_NUMBER() OVER(            PARTITION BY company, location, industry, total_laid_off, percentage_laid_off, 'date',...

Use of Application.CutCopyPaste=False

 Use the below line right after copying & pasting data using VBA. Below line clears the copied data from the clipboard. Application.CutCopyPaste=False Without that line you will get the warning 'There is a large amount of information on the Clipboard....' when you close the workbook with a large amount of data on the clipboard.

VBA Outlook - Ways to send email from a specific email account

Early Binding   Dim oApp as Outlook.Application Dim oEmail as Outlook.MailItem Dim oNS as Outlook.NameSpace Set oApp=New Outlook.Application Set oEmail=oApp.CreateItem(olMailItem) Set oNS=oApp.GetNamespace("MAPI")  'Messaging Application Programming Interface oEmail.SendUsingAccout=oNS.Accounts.Item(1) 'To send email from a specific account. Or Use With oEmail     .SentOnBehalfOfName="Enter the specific account email-id." end With Late Binding Dim oApp as Object Dim oEmail as Object Dim oNS as Object Set oApp=CreateObject("Outlook.Application") Set oEmail=oApp.CreateItem(0) Set oNS=oApp.GetNamespace("MAPI") 'Messaging Application Programming Interface oEmail.SendUsingAccount=oNS.Accounts.Item(1) 'To send email from a specific account. Or Use With oEmail     .SentOnBehalfOfName="Enter the specific account email-id." end With

VBA Outlook - Convert Early Binding to Late Binding

Early Binding First establish the reference with the outlook library by going to 'Tools' Tab then Click on 'References', from the available reference Select the "Microsoft Outlook 16.0 Object Library", 16.0 could be 14.0 or 15.0 basis on the version of the Microsoft Office in your system. Dim oApp as Outlook.Application Dim oEmail as Outlook.MailItem Dim oNS as Outlook.NameSpace Set oApp=New Outlook.Application Set oEmail=oApp.CreateItem(olMailItem) Set oNS=oApp.GetNamespace("MAPI")  oEmail.SendUsingAccout=oNS.Accounts.Item(1) 'To send email from a specific account. Late Binding No need to establish relationship with any library. Dim oApp as Object Dim oEmail as Object Dim oNS as Object Set oApp=CreateObject("Outlook.Application") Set oEmail=oApp.CreateItem(0) Set oNS=oApp.GetNamespace("MAPI") oEmail.SendUsingAccount=oNS.Accounts.Item(1) 'To send email from a specific account.

Outlook Email Automation Examples

 Outlook Email Automation Examples 1) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sub SendMail_Bangalore() Dim oApp As Outlook.Application Dim OEmail As Outlook.MailItem Dim signature As String Dim str As String Dim loc As String Set oApp = New Outlook.Application Set OEmail = oApp.CreateItem(olMailItem) Dim olNS As Outlook.Namespace Set olNS = Outlook.Application.GetNamespace("MAPI") OEmail.SendUsingAccount = olNS.Accounts.Item(1) loc = "Bangalore" If Sheet1.Range("b10").Value < 2 Then str = "Hi All," & "<br/><br/>" & "Mentioned Package ID " & Sheet1.Range("b9").Value & " has been renewed for next " & Sheet1.Range("b10").Value _ & " day. Service will start from " & Format(Sheet1.Range("b11").Value, "DD-MMM") & "." & "<br/><br/>" Else str = "Hi All...