Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dim Dim is offline
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink to cell within a sheet breaks when cells are sorted CJ55 Excel Worksheet Functions 1 November 3rd 09 04:02 PM
Can't make hyperlink function work for hyperlink to website Frank B Denman Excel Worksheet Functions 15 February 5th 07 11:01 PM
Hyperlink in cell with line breaks [email protected] Excel Discussion (Misc queries) 4 July 18th 06 06:02 PM
Moving rows with Hyperlink doesn't move hyperlink address Samad Excel Discussion (Misc queries) 15 June 22nd 06 12:03 PM
Intra-workbook hyperlink: macro/function to return to hyperlink ce marika1981 Excel Discussion (Misc queries) 3 May 6th 05 05:47 AM


All times are GMT +1. The time now is 10:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"