Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to change display address in Macro

Hi,

I have  a macro in qvw and is it possible to change the display address. i,e when I am clicking OK the file is coming to my email but it's showing my name as display address instead of my name will it be possible to get different name.

sub ExcelFile

  strDate = CDate(Date)
  strDay = DatePart("d", strDate)
  strMonth = DatePart("m", strDate)
  strYear = DatePart("yyyy", strDate)
  If strDay < 10 Then
    strDay = "0" & strDay
  End If
  If strMonth < 10 Then
    strMonth = "0" & strMonth
  End If
  GetFormattedDate = strMonth & "-" & strDay & "-" & strYear
  Set v = ActiveDocument.Variables ("EmailAddress")
  Email=v.GetContent.String

Path = "D:\Amelia Disousa\"
FileName = "Test_" & GetFormattedDate  & ".xlsx"

set XLApp = CreateObject("Excel.Application")

XLApp.Visible = False
set XLDoc = XLApp.Workbooks.Add

ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true
XLDoc.Sheets(1).Paste()

XLDoc.Sheets(1).Columns("A:D").EntireColumn.AutoFit
XLDoc.Sheets(1).Columns("A:A").ColumnWidth = 15.57
XLDoc.Sheets(1).Columns("B:B").ColumnWidth = 12.43
XLDoc.Sheets(1).Columns("C:C").ColumnWidth = 15.29
XLDoc.Sheets(1).Columns("D:D").ColumnWidth = 15.57

XLDoc.Sheets(1).Name = "Export"
XLDoc.SaveAs Path & FileName
XLApp.Quit

Set myApp = CreateObject ("Outlook.Application")
Set myMessage = myApp.CreateItem(olMailItem)
myMessage.BodyFormat = 3 'Outlook.OlBodyFormat.olFormatRichText

myMessage.To = "amelia.disousa@xx.vv.com"
myMessage.Attachments.Add "D:\Amelia Disousa\" & FileName
myMessage.Subject = "Test File " & Date()

myMessage.Send

Set myMessage = Nothing
Set myApp = Nothing
Set myInspector = Nothing
Set myDoc = Nothing

end sub

Thanks.

32 Replies
Not applicable
Author

Thanks and Could I know what is standard reports means?

marcus_sommer

It meant that there are many equal reports with the different of various regions, products, time ranges and so on for various users - it meant the same report will be x-times in a loop executed with different selections.

- Marcus

Not applicable
Author

Thanks and I nned to have automatical excel file to my user outlook email and the excel data is from one straight table and this straight table is single one and it is not looping. In this case if I create a button in qvw file and if I make available the qvw file in access point then without logging to access point my user will get excel file to their mail i,e just like offline process for eg: if my user is out of office at that time I want to send excel to his/her mail means will it possible with this so overall I wouln't need my user to depend on access point. Please let me know this if you don't mind.

Once again thanks.