Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
hyperlink breaks if space within hyperlink
i'm trying to send out email with a hyperlink (path) to a file on a
network. Email generated from Excel2K using outlook2K. Problem is that hyperlink contains a space within the path.. when link is created in a cell it's just fine but when i try to move that link to the body of a email that where the brake happens: if that path is created in the cell "\\ny-gdpcommod-1\Ferm$\Power (space) Operations\filename.xls" and then i insert that hyperlink into email body through a variable string or getting value directly from a cell it assumes that hyperlink is only up to that space between Power and operations "\\ny-gdpcommod-1\Ferm$\Power " i'm generating a hyperlink in spreadsheet to a file with the following code: With Worksheets("Main") .Hyperlinks.Add .Range("s5"), _ "\\ny-gdpcommod-1\Ferm$\Power Operations\Test\DailyPosition_" & Format(dDate, "YYYYMMDD") & ".xls" End With and then i'm trying to asign that hyperlink within the body of email: Set objOutlook = CreateObject("Outlook.Application") Set objMailItem = objOutlook.CreateItem(olMailItem) With objMailItem .Recipients.Add " .Body = Sheets("Main").Range("s5") .send end with thanks in advance for a help. Dim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
hyperlink breaks if space within hyperlink
A valid URL does not contain spaces. Try replacing each space with '%20'
(without the quotes). Dim wrote: i'm trying to send out email with a hyperlink (path) to a file on a network. Email generated from Excel2K using outlook2K. Problem is that hyperlink contains a space within the path.. when link is created in a cell it's just fine but when i try to move that link to the body of a email that where the brake happens: if that path is created in the cell "\\ny-gdpcommod-1\Ferm$\Power (space) Operations\filename.xls" and then i insert that hyperlink into email body through a variable string or getting value directly from a cell it assumes that hyperlink is only up to that space between Power and operations "\\ny-gdpcommod-1\Ferm$\Power " i'm generating a hyperlink in spreadsheet to a file with the following code: With Worksheets("Main") .Hyperlinks.Add .Range("s5"), _ "\\ny-gdpcommod-1\Ferm$\Power Operations\Test\DailyPosition_" & Format(dDate, "YYYYMMDD") & ".xls" End With and then i'm trying to asign that hyperlink within the body of email: Set objOutlook = CreateObject("Outlook.Application") Set objMailItem = objOutlook.CreateItem(olMailItem) With objMailItem .Recipients.Add " .Body = Sheets("Main").Range("s5") .send end with thanks in advance for a help. Dim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hyperlink to cell within a sheet breaks when cells are sorted | Excel Worksheet Functions | |||
Can't make hyperlink function work for hyperlink to website | Excel Worksheet Functions | |||
Hyperlink in cell with line breaks | Excel Discussion (Misc queries) | |||
Moving rows with Hyperlink doesn't move hyperlink address | Excel Discussion (Misc queries) | |||
Intra-workbook hyperlink: macro/function to return to hyperlink ce | Excel Discussion (Misc queries) |