Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Save this web page with value of the active cell in sheet2

Hi

Sub SaveTempletAsWebpage()

Range("A5:Q70").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Test\Page.htm" _
, "sheet1", "$A$5:$Q$70", xlHtmlStatic, "Book1_16704", "" _
)
.Publish (True)
.AutoRepublish = False
End With
ChDir _
"C:\Test"
End Sub

I would like to save this web page with value of the active cell in sheet2
which is B1

Thanks in advance

Dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Save this web page with value of the active cell in sheet2

oops

Name the web page the as the value of the cell.

Thanks in advance

Dave


"DaveM" wrote in message
. uk...
Hi

Sub SaveTempletAsWebpage()

Range("A5:Q70").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Test\Page.htm" _
, "sheet1", "$A$5:$Q$70", xlHtmlStatic, "Book1_16704", "" _
)
.Publish (True)
.AutoRepublish = False
End With
ChDir _
"C:\Test"
End Sub

I would like to save this web page with value of the active cell in sheet2
which is B1

Thanks in advance

Dave



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Save this web page with value of the active cell in sheet2

Untested:

With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Test\" & Sheet2.Range("B1").Value, _
"sheet1", "$A$5:$Q$70", xlHtmlStatic, "Book1_16704", "")

I'm using the sheet2 codename - if you want to use the tab name it would be
Activeworkbook.sheets("Sheet2").Range("B1").value

Tim


"DaveM" wrote in message
. uk...
Hi

Sub SaveTempletAsWebpage()

Range("A5:Q70").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Test\Page.htm" _
, "sheet1", "$A$5:$Q$70", xlHtmlStatic, "Book1_16704", "" _
)
.Publish (True)
.AutoRepublish = False
End With
ChDir _
"C:\Test"
End Sub

I would like to save this web page with value of the active cell in sheet2
which is B1

Thanks in advance

Dave



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Save this web page with value of the active cell in sheet2

Thanks Tim

Works a treat

All the best

Dave


"Tim Williams" <timjwilliams at gmail dot com wrote in message
...
Untested:

With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Test\" & Sheet2.Range("B1").Value, _
"sheet1", "$A$5:$Q$70", xlHtmlStatic, "Book1_16704", "")

I'm using the sheet2 codename - if you want to use the tab name it would
be
Activeworkbook.sheets("Sheet2").Range("B1").value

Tim


"DaveM" wrote in message
. uk...
Hi

Sub SaveTempletAsWebpage()

Range("A5:Q70").Select
With ActiveWorkbook.PublishObjects.Add(xlSourceRange, _
"C:\Test\Page.htm" _
, "sheet1", "$A$5:$Q$70", xlHtmlStatic, "Book1_16704", "" _
)
.Publish (True)
.AutoRepublish = False
End With
ChDir _
"C:\Test"
End Sub

I would like to save this web page with value of the active cell in
sheet2 which is B1

Thanks in advance

Dave





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
copy data from sheet2 to sheet1 when sheet2 has variable # of rows Anne Excel Discussion (Misc queries) 6 February 27th 09 09:48 PM
how do i insert page number on active cell? gendut Excel Discussion (Misc queries) 1 August 14th 08 04:18 AM
save worksheet as per the active cell Ranjit kurian Excel Programming 2 May 13th 08 02:47 PM
How to save a workbook to an active Web Page? Nadia Excel Discussion (Misc queries) 0 May 2nd 08 06:23 PM
Screen does not scroll as active cell moves down the page KimC Excel Discussion (Misc queries) 3 May 8th 07 06:45 PM


All times are GMT +1. The time now is 05:58 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"