Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Change Hypenlink Automatically

I have a macro which does the following:

1.- Save the excel template file (template.xls) as
WO = Worksheets("summary BLR").Range("M10")
myDateTime = Format(Worksheets("summary BLR").Range("M9").Value, "yyyymmdd")
Filename = "" & WO & "_grdprp_" & myDateTime & ""
Progname = "C:\form\" & Filename & ".xls"
ActiveWorkbook.SaveCopyAs Progname
The filename is created from the template cells

2.- Open an word template file (Template.doc)

3.- Save the template word file as the save name given in the step 1
Dim sDocName As String
sDocName = Replace(sPath, ".xls", ".doc")
ActiveDocument.SaveAs sDocName

4.- Change the sources and update the link from the file created in the step 1

5.- Close the Template.xls

However, I have a hyperlink rectangular in the Template.xls linked to the
Template.doc that I want to change the name automatically to the new word
document saved in the step 3 (the path is the same)

Could you please help me to build the statement for this step?

Thanks in advance.
Maperalia


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Change Hypenlink Automatically

Can you record a macro in MSWord when you change a hyperlink. Then you'll have
the MSWord code that could be added to your excel code.



maperalia wrote:

I have a macro which does the following:

1.- Save the excel template file (template.xls) as
WO = Worksheets("summary BLR").Range("M10")
myDateTime = Format(Worksheets("summary BLR").Range("M9").Value, "yyyymmdd")
Filename = "" & WO & "_grdprp_" & myDateTime & ""
Progname = "C:\form\" & Filename & ".xls"
ActiveWorkbook.SaveCopyAs Progname
The filename is created from the template cells

2.- Open an word template file (Template.doc)

3.- Save the template word file as the save name given in the step 1
Dim sDocName As String
sDocName = Replace(sPath, ".xls", ".doc")
ActiveDocument.SaveAs sDocName

4.- Change the sources and update the link from the file created in the step 1

5.- Close the Template.xls

However, I have a hyperlink rectangular in the Template.xls linked to the
Template.doc that I want to change the name automatically to the new word
document saved in the step 3 (the path is the same)

Could you please help me to build the statement for this step?

Thanks in advance.
Maperalia


--

Dave Peterson
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
Change Tag Name Automatically maperalia Excel Programming 2 December 7th 05 07:32 PM
Automatically change tab reference TWC Excel Discussion (Misc queries) 2 February 2nd 05 10:17 PM
how do i make a date change automatically if i change one before . dpl7579 Excel Discussion (Misc queries) 1 January 11th 05 09:21 PM
change automatically a value when another cell value changes CC Excel Worksheet Functions 2 January 7th 05 02:12 PM
change one sheet, and automatically the others Dummie Excel Worksheet Functions 1 November 18th 04 01:34 AM


All times are GMT +1. The time now is 03:03 PM.

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

About Us

"It's about Microsoft Excel"