Create Hyperlink to cell referenced file path in VBA automated email.

jenpauh

New Member
Joined
Jan 22, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello, I have not posted here before but if someone could help me resolve this problem I would really appreciate it, as the other posts I have referenced have not been successful for me. I will lay out what my VBA form currently does.

-User submits info into a request form...
-This information goes to specific cells in a separate sheet in the workbook...
-A folder is automatically created on a shared network drive named using concatenate function of certain cells...
-Email is sent off to distribution list...The folder file path is added by referencing a cell (through concatenate function)

I am hoping to automatically hyperlink the "File Path" to open the newly created folder through the email. Is it possible to modify my current code to make this work?
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim sTO As String, sSubj As String

sTO = [AE1]
sSubj = [AG1]

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

strbody = Range("AK1") & vbNewLine & _
"" & vbNewLine & _
Range("AM1") & vbNewLine & _
Range("BE1")

Above (BE1) is the reference cell which uses concatenate to add the file path of the new folder to the email...This is the goal hyperlinked folder

On Error Resume Next
With OutMail
.TO = sTO
.CC = ""
.BCC = ""
.Subject = sSubj
.Body = strbody
.Send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing


ActiveCell.Offset(1, 0).Select

ActiveWorkbook.Sheets("Data").Select


Application.DisplayAlerts = False
With ThisWorkbook
.Save


On Error Resume Next

ActiveWorkbook.RefreshAll

For i = 2 To 2
MkDir "C:\Users\SHARED DRIVE NAME\SETUP FOLDER\" & Range("O" & i)
Next i

Above is the newly created folder code

Unload Me


End With


End Sub
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thanks for any help, I really appreciate it.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top