Hyperlink to Launch Excel with data

MAinsworth

New Member
Joined
Sep 26, 2011
Messages
2
I'm using vba code to send an email to users of a common spreadsheet. This spreadsheet contains lines of data. Is it possible to send a link in a html email to open the excel spreadsheet (Book1.xls) with a particular value in a cell. I've extracted the code below, the bit in red is where I need help.

Sub SendEmail()
Dim OutApp As Object
Dim OutMail As Object
Dim eMsg As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)


eMsg = "<br>This is a test. <a href = C:\Book1.xls A1=22>Test</a>"

With OutMail
.BodyFormat = olFormatHTML
.To = "fred"
.Subject = "test"
.HTMLBody = eMsg
End With


OutMail.Display
Set OutMail = Nothing
Set OutApp = Nothing
End Sub


Thanks,

Martin.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

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