Run same macro in different versions of Excel / Outlook / Word











up vote
1
down vote

favorite
1












At my work, I generate reports to send to different branches. I run a macro that creates protected reports (*.xlsm). These reports have a space for comments for the Branch Managers, with a "send Comments" button that run this macro below. I suggested the following references for them to add in if the macro does not work.



The Branch Managers have different versions of MS Office (Excel, Outlook, etc) on their laptops. When they try to Run, it shows errors, such as: "Error in Loadind DLL"; Error2, etc.



What should I do on the Branch Managers side for them to be able to run this Macro?



Sub CommentsEmail()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OutApp As Object
Dim OutMail As Object
Dim olApp As Outlook.Application
Dim mymail As Outlook.mailItem
Dim objSel As Word.Selection
Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Shell ("Outlook")

Set olApp = New Outlook.Application
Set mymail = olApp.CreateItem(olMailItem)
Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

template.Activate


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

'OutMail.Display
Dim wordDoc As Word.Document
Set wordDoc = OutMail.GetInspector.WordEditor

Set objSel = wordDoc.Windows(1).Selection

'construct the body of the email here
With objSel

'first text
.InsertAfter "Dear All," & vbCrLf
.Move wdParagraph, 1

'second text
.InsertAfter vbCrLf & "See below the Comments for Flash Indicator - " & branch & vbCrLf & vbCrLf
.Move wdParagraph, 1

'copy a range and paste a picture
commentsrange.Copy ''again, you need to modify your target range
.PasteAndFormat wdChartPicture
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Let us know of any questions." & vbCrLf & vbCrLf
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Kind Regards," & vbCrLf
End With

OutMail.To = OutMail.To & ";" & Sendto

With OutMail

.Subject = "Comments on Flash Indicator Results - " & branch
.Attachments.Add (ActiveWorkbook.FullName)
.Display
End With

On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub


Is this still early binding?? If yes, I am totally lost...



Sub CommentsEmail2()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OlaApp As Object
Dim OleMail As Object

Dim TempFilePath As String
Dim xHTMLBody As String

Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)

template.Activate

On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If Err <> 0 Then Set olApp = CreateObject("Outlook.Application")
On Error GoTo 0
Set OleMail = olApp.CreateItem(0)

Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile")
TempFilePath = Environ$("temp") & ""
xHTMLBody = "<span LANG=EN>" _
& "<p class=style2><span LANG=EN><font FACE=Calibri SIZE=3>" _
& "Hello, this is the data range that you want:<br> " _
& "<br>" _
& "<img src='cid:DashboardFile.jpg'>" _
& "<br>Best Regards!</font></span>"
With OleMail
.Subject = "test"
.HTMLBody = xHTMLBody
.Attachments.Add TempFilePath & "DashboardFile.jpg", olByValue
.Attachments.Add (ActiveWorkbook.FullName)
.To = " "
.Cc = " "
.Display
End With




Set OleMail = Nothing
Set OlaApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub

Sub createJpg(SheetName As String, commentsrange As String, nameFile As String)
Dim xRgPic As Range
ThisWorkbook.Activate
Worksheets(comments).Activate
Set xRgPic = ThisWorkbook.Worksheets(comments).Range(Cells(7, 1), Cells(52, 4))
xRgPic.CopyPicture
With ThisWorkbook.Worksheets(comments).ChartObjects.Add(xRgPic.Left, xRgPic.Top, xRgPic.Width, xRgPic.Height)
.Activate
.Chart.Paste
.Chart.Export Environ$("temp") & "" & nameFile & ".jpg", "JPG"
End With
Worksheets(comments).ChartObjects(Worksheets(comments).ChartObjects.Count).Delete
Set xRgPic = Nothing
End Sub









share|improve this question




















  • 1




    Look up how to use late binding instead of early binding. There are helpful questions already on SO.
    – BigBen
    Nov 7 at 17:02












  • @BigBen Thanks for your help! I tried but I couldnt find a solution to paste the range as a picture, without having to open word Document.
    – Leonardo Stamato
    Nov 7 at 22:46










  • You should be able to do that still with late binding. Maybe post your revised code?
    – BigBen
    Nov 7 at 23:01










  • @BigBen This last code is where I stopped. I tried to copy a range of the report and paste as an image in the email body. it says the "commentsrange" on Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile") is mismatching.
    – Leonardo Stamato
    Nov 7 at 23:17










  • @BigBen how do I share the file with you? Thank you in advance
    – Leonardo Stamato
    Nov 7 at 23:43















up vote
1
down vote

favorite
1












At my work, I generate reports to send to different branches. I run a macro that creates protected reports (*.xlsm). These reports have a space for comments for the Branch Managers, with a "send Comments" button that run this macro below. I suggested the following references for them to add in if the macro does not work.



The Branch Managers have different versions of MS Office (Excel, Outlook, etc) on their laptops. When they try to Run, it shows errors, such as: "Error in Loadind DLL"; Error2, etc.



What should I do on the Branch Managers side for them to be able to run this Macro?



Sub CommentsEmail()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OutApp As Object
Dim OutMail As Object
Dim olApp As Outlook.Application
Dim mymail As Outlook.mailItem
Dim objSel As Word.Selection
Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Shell ("Outlook")

Set olApp = New Outlook.Application
Set mymail = olApp.CreateItem(olMailItem)
Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

template.Activate


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

'OutMail.Display
Dim wordDoc As Word.Document
Set wordDoc = OutMail.GetInspector.WordEditor

Set objSel = wordDoc.Windows(1).Selection

'construct the body of the email here
With objSel

'first text
.InsertAfter "Dear All," & vbCrLf
.Move wdParagraph, 1

'second text
.InsertAfter vbCrLf & "See below the Comments for Flash Indicator - " & branch & vbCrLf & vbCrLf
.Move wdParagraph, 1

'copy a range and paste a picture
commentsrange.Copy ''again, you need to modify your target range
.PasteAndFormat wdChartPicture
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Let us know of any questions." & vbCrLf & vbCrLf
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Kind Regards," & vbCrLf
End With

OutMail.To = OutMail.To & ";" & Sendto

With OutMail

.Subject = "Comments on Flash Indicator Results - " & branch
.Attachments.Add (ActiveWorkbook.FullName)
.Display
End With

On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub


Is this still early binding?? If yes, I am totally lost...



Sub CommentsEmail2()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OlaApp As Object
Dim OleMail As Object

Dim TempFilePath As String
Dim xHTMLBody As String

Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)

template.Activate

On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If Err <> 0 Then Set olApp = CreateObject("Outlook.Application")
On Error GoTo 0
Set OleMail = olApp.CreateItem(0)

Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile")
TempFilePath = Environ$("temp") & ""
xHTMLBody = "<span LANG=EN>" _
& "<p class=style2><span LANG=EN><font FACE=Calibri SIZE=3>" _
& "Hello, this is the data range that you want:<br> " _
& "<br>" _
& "<img src='cid:DashboardFile.jpg'>" _
& "<br>Best Regards!</font></span>"
With OleMail
.Subject = "test"
.HTMLBody = xHTMLBody
.Attachments.Add TempFilePath & "DashboardFile.jpg", olByValue
.Attachments.Add (ActiveWorkbook.FullName)
.To = " "
.Cc = " "
.Display
End With




Set OleMail = Nothing
Set OlaApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub

Sub createJpg(SheetName As String, commentsrange As String, nameFile As String)
Dim xRgPic As Range
ThisWorkbook.Activate
Worksheets(comments).Activate
Set xRgPic = ThisWorkbook.Worksheets(comments).Range(Cells(7, 1), Cells(52, 4))
xRgPic.CopyPicture
With ThisWorkbook.Worksheets(comments).ChartObjects.Add(xRgPic.Left, xRgPic.Top, xRgPic.Width, xRgPic.Height)
.Activate
.Chart.Paste
.Chart.Export Environ$("temp") & "" & nameFile & ".jpg", "JPG"
End With
Worksheets(comments).ChartObjects(Worksheets(comments).ChartObjects.Count).Delete
Set xRgPic = Nothing
End Sub









share|improve this question




















  • 1




    Look up how to use late binding instead of early binding. There are helpful questions already on SO.
    – BigBen
    Nov 7 at 17:02












  • @BigBen Thanks for your help! I tried but I couldnt find a solution to paste the range as a picture, without having to open word Document.
    – Leonardo Stamato
    Nov 7 at 22:46










  • You should be able to do that still with late binding. Maybe post your revised code?
    – BigBen
    Nov 7 at 23:01










  • @BigBen This last code is where I stopped. I tried to copy a range of the report and paste as an image in the email body. it says the "commentsrange" on Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile") is mismatching.
    – Leonardo Stamato
    Nov 7 at 23:17










  • @BigBen how do I share the file with you? Thank you in advance
    – Leonardo Stamato
    Nov 7 at 23:43













up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





At my work, I generate reports to send to different branches. I run a macro that creates protected reports (*.xlsm). These reports have a space for comments for the Branch Managers, with a "send Comments" button that run this macro below. I suggested the following references for them to add in if the macro does not work.



The Branch Managers have different versions of MS Office (Excel, Outlook, etc) on their laptops. When they try to Run, it shows errors, such as: "Error in Loadind DLL"; Error2, etc.



What should I do on the Branch Managers side for them to be able to run this Macro?



Sub CommentsEmail()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OutApp As Object
Dim OutMail As Object
Dim olApp As Outlook.Application
Dim mymail As Outlook.mailItem
Dim objSel As Word.Selection
Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Shell ("Outlook")

Set olApp = New Outlook.Application
Set mymail = olApp.CreateItem(olMailItem)
Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

template.Activate


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

'OutMail.Display
Dim wordDoc As Word.Document
Set wordDoc = OutMail.GetInspector.WordEditor

Set objSel = wordDoc.Windows(1).Selection

'construct the body of the email here
With objSel

'first text
.InsertAfter "Dear All," & vbCrLf
.Move wdParagraph, 1

'second text
.InsertAfter vbCrLf & "See below the Comments for Flash Indicator - " & branch & vbCrLf & vbCrLf
.Move wdParagraph, 1

'copy a range and paste a picture
commentsrange.Copy ''again, you need to modify your target range
.PasteAndFormat wdChartPicture
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Let us know of any questions." & vbCrLf & vbCrLf
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Kind Regards," & vbCrLf
End With

OutMail.To = OutMail.To & ";" & Sendto

With OutMail

.Subject = "Comments on Flash Indicator Results - " & branch
.Attachments.Add (ActiveWorkbook.FullName)
.Display
End With

On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub


Is this still early binding?? If yes, I am totally lost...



Sub CommentsEmail2()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OlaApp As Object
Dim OleMail As Object

Dim TempFilePath As String
Dim xHTMLBody As String

Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)

template.Activate

On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If Err <> 0 Then Set olApp = CreateObject("Outlook.Application")
On Error GoTo 0
Set OleMail = olApp.CreateItem(0)

Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile")
TempFilePath = Environ$("temp") & ""
xHTMLBody = "<span LANG=EN>" _
& "<p class=style2><span LANG=EN><font FACE=Calibri SIZE=3>" _
& "Hello, this is the data range that you want:<br> " _
& "<br>" _
& "<img src='cid:DashboardFile.jpg'>" _
& "<br>Best Regards!</font></span>"
With OleMail
.Subject = "test"
.HTMLBody = xHTMLBody
.Attachments.Add TempFilePath & "DashboardFile.jpg", olByValue
.Attachments.Add (ActiveWorkbook.FullName)
.To = " "
.Cc = " "
.Display
End With




Set OleMail = Nothing
Set OlaApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub

Sub createJpg(SheetName As String, commentsrange As String, nameFile As String)
Dim xRgPic As Range
ThisWorkbook.Activate
Worksheets(comments).Activate
Set xRgPic = ThisWorkbook.Worksheets(comments).Range(Cells(7, 1), Cells(52, 4))
xRgPic.CopyPicture
With ThisWorkbook.Worksheets(comments).ChartObjects.Add(xRgPic.Left, xRgPic.Top, xRgPic.Width, xRgPic.Height)
.Activate
.Chart.Paste
.Chart.Export Environ$("temp") & "" & nameFile & ".jpg", "JPG"
End With
Worksheets(comments).ChartObjects(Worksheets(comments).ChartObjects.Count).Delete
Set xRgPic = Nothing
End Sub









share|improve this question















At my work, I generate reports to send to different branches. I run a macro that creates protected reports (*.xlsm). These reports have a space for comments for the Branch Managers, with a "send Comments" button that run this macro below. I suggested the following references for them to add in if the macro does not work.



The Branch Managers have different versions of MS Office (Excel, Outlook, etc) on their laptops. When they try to Run, it shows errors, such as: "Error in Loadind DLL"; Error2, etc.



What should I do on the Branch Managers side for them to be able to run this Macro?



Sub CommentsEmail()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OutApp As Object
Dim OutMail As Object
Dim olApp As Outlook.Application
Dim mymail As Outlook.mailItem
Dim objSel As Word.Selection
Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Shell ("Outlook")

Set olApp = New Outlook.Application
Set mymail = olApp.CreateItem(olMailItem)
Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

template.Activate


Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

'OutMail.Display
Dim wordDoc As Word.Document
Set wordDoc = OutMail.GetInspector.WordEditor

Set objSel = wordDoc.Windows(1).Selection

'construct the body of the email here
With objSel

'first text
.InsertAfter "Dear All," & vbCrLf
.Move wdParagraph, 1

'second text
.InsertAfter vbCrLf & "See below the Comments for Flash Indicator - " & branch & vbCrLf & vbCrLf
.Move wdParagraph, 1

'copy a range and paste a picture
commentsrange.Copy ''again, you need to modify your target range
.PasteAndFormat wdChartPicture
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Let us know of any questions." & vbCrLf & vbCrLf
.Move wdParagraph, 1

.InsertAfter vbCrLf & "Kind Regards," & vbCrLf
End With

OutMail.To = OutMail.To & ";" & Sendto

With OutMail

.Subject = "Comments on Flash Indicator Results - " & branch
.Attachments.Add (ActiveWorkbook.FullName)
.Display
End With

On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub


Is this still early binding?? If yes, I am totally lost...



Sub CommentsEmail2()

Dim template As Workbook
Dim dashboard As Worksheet
Dim comments As Worksheet
Dim OlaApp As Object
Dim OleMail As Object

Dim TempFilePath As String
Dim xHTMLBody As String

Dim commentsrange As Range
Dim branch As String
Dim Sendto As String

UpdateScreen = False

Set template = ActiveWorkbook
Set dashboard = template.Worksheets("Dashboard")
Set comments = template.Worksheets("Comments")
Set commentsrange = comments.Range(Cells(7, 1), Cells(52, 4))

branch = dashboard.Cells(1, 25)
Sendto = comments.Cells(2, 10)

template.Activate

On Error Resume Next
Set olApp = GetObject(, "Outlook.Application")
If Err <> 0 Then Set olApp = CreateObject("Outlook.Application")
On Error GoTo 0
Set OleMail = olApp.CreateItem(0)

Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile")
TempFilePath = Environ$("temp") & ""
xHTMLBody = "<span LANG=EN>" _
& "<p class=style2><span LANG=EN><font FACE=Calibri SIZE=3>" _
& "Hello, this is the data range that you want:<br> " _
& "<br>" _
& "<img src='cid:DashboardFile.jpg'>" _
& "<br>Best Regards!</font></span>"
With OleMail
.Subject = "test"
.HTMLBody = xHTMLBody
.Attachments.Add TempFilePath & "DashboardFile.jpg", olByValue
.Attachments.Add (ActiveWorkbook.FullName)
.To = " "
.Cc = " "
.Display
End With




Set OleMail = Nothing
Set OlaApp = Nothing


With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Exit Sub

End Sub

Sub createJpg(SheetName As String, commentsrange As String, nameFile As String)
Dim xRgPic As Range
ThisWorkbook.Activate
Worksheets(comments).Activate
Set xRgPic = ThisWorkbook.Worksheets(comments).Range(Cells(7, 1), Cells(52, 4))
xRgPic.CopyPicture
With ThisWorkbook.Worksheets(comments).ChartObjects.Add(xRgPic.Left, xRgPic.Top, xRgPic.Width, xRgPic.Height)
.Activate
.Chart.Paste
.Chart.Export Environ$("temp") & "" & nameFile & ".jpg", "JPG"
End With
Worksheets(comments).ChartObjects(Worksheets(comments).ChartObjects.Count).Delete
Set xRgPic = Nothing
End Sub






excel-vba outlook-addin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 23:35

























asked Nov 7 at 16:59









Leonardo Stamato

62




62








  • 1




    Look up how to use late binding instead of early binding. There are helpful questions already on SO.
    – BigBen
    Nov 7 at 17:02












  • @BigBen Thanks for your help! I tried but I couldnt find a solution to paste the range as a picture, without having to open word Document.
    – Leonardo Stamato
    Nov 7 at 22:46










  • You should be able to do that still with late binding. Maybe post your revised code?
    – BigBen
    Nov 7 at 23:01










  • @BigBen This last code is where I stopped. I tried to copy a range of the report and paste as an image in the email body. it says the "commentsrange" on Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile") is mismatching.
    – Leonardo Stamato
    Nov 7 at 23:17










  • @BigBen how do I share the file with you? Thank you in advance
    – Leonardo Stamato
    Nov 7 at 23:43














  • 1




    Look up how to use late binding instead of early binding. There are helpful questions already on SO.
    – BigBen
    Nov 7 at 17:02












  • @BigBen Thanks for your help! I tried but I couldnt find a solution to paste the range as a picture, without having to open word Document.
    – Leonardo Stamato
    Nov 7 at 22:46










  • You should be able to do that still with late binding. Maybe post your revised code?
    – BigBen
    Nov 7 at 23:01










  • @BigBen This last code is where I stopped. I tried to copy a range of the report and paste as an image in the email body. it says the "commentsrange" on Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile") is mismatching.
    – Leonardo Stamato
    Nov 7 at 23:17










  • @BigBen how do I share the file with you? Thank you in advance
    – Leonardo Stamato
    Nov 7 at 23:43








1




1




Look up how to use late binding instead of early binding. There are helpful questions already on SO.
– BigBen
Nov 7 at 17:02






Look up how to use late binding instead of early binding. There are helpful questions already on SO.
– BigBen
Nov 7 at 17:02














@BigBen Thanks for your help! I tried but I couldnt find a solution to paste the range as a picture, without having to open word Document.
– Leonardo Stamato
Nov 7 at 22:46




@BigBen Thanks for your help! I tried but I couldnt find a solution to paste the range as a picture, without having to open word Document.
– Leonardo Stamato
Nov 7 at 22:46












You should be able to do that still with late binding. Maybe post your revised code?
– BigBen
Nov 7 at 23:01




You should be able to do that still with late binding. Maybe post your revised code?
– BigBen
Nov 7 at 23:01












@BigBen This last code is where I stopped. I tried to copy a range of the report and paste as an image in the email body. it says the "commentsrange" on Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile") is mismatching.
– Leonardo Stamato
Nov 7 at 23:17




@BigBen This last code is where I stopped. I tried to copy a range of the report and paste as an image in the email body. it says the "commentsrange" on Call createJpg(ActiveSheet.comments, commentsrange, "DashboardFile") is mismatching.
– Leonardo Stamato
Nov 7 at 23:17












@BigBen how do I share the file with you? Thank you in advance
– Leonardo Stamato
Nov 7 at 23:43




@BigBen how do I share the file with you? Thank you in advance
– Leonardo Stamato
Nov 7 at 23:43

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194264%2frun-same-macro-in-different-versions-of-excel-outlook-word%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194264%2frun-same-macro-in-different-versions-of-excel-outlook-word%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()