May 2, 2023
I am having a terrible time writing a simple string body that pulls information from Excel workbook columns.
I've even tried copying the format from a macro that I wrote with similar functionality but it still doesn't work -even after I've change the lines of the string (code).
The Macro is named 'FedexinfoToSite on the attached workbook
Help and thanks in advance
October 17, 2018
Hi Roger, you should keep in mind when attaching a file with data links you make sure they work for others.
We do not have access to the connection at your shareppoint sciuusa etc...
Your question is about the macro but a file that first needs to braek links or skip updates is a P in the A when trying to help
October 5, 2010
You haven't actually said what the problem is, and any error that VBA generated would assist in finding the issue.
However after running the code I can see VBA gives a type mismatch error which indicates that, as you are trying to build a string, you are using something that isn't a string.
Looking at your code I see you are trying to include the FedEx tracking number in the string, but this is a number.
To make the code work you need to cast the number to the string type using the CStr function
strbody = "Good Afternoon " + Cells(I, 17).Value + "," _
& vbNewLine & vbNewLine _
& "The above's Fedex tracking number is " + CStr(Cells(I, 27).Value) + _
vbNewLine & vbNewLine & vbNewLine & vbNewLine _
November 1, 2018