Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 8
Default Why doesnt this work

Dear All,

Can you have a look at this and please tell why it doesnt work




Sub CopySheetAsHTML()

Dim fName As String
Dim wks As Worksheet

Set wks = ActiveSheet
fName = wks.Range("J4").Value

With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
"I:\" & fName & ".htm", wks.Name, "DataRange", _
xlHtmlStatic, wks.Range("J4").Value)
.Publish (True)
End With
End Sub




Many Thanks in advance



Steve
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 897
Default Why doesnt this work

Where to start?

1. Do you have this code in a standard Excel module?
2. Do you have a worksheet (not a chart sheet) activated? If so, is
there anything in cell J4? If so, what?
3. Do you have an I: drive?
4. Is the workbook saved?
5. Is "DataRange" referring to anything?


HTH,
JP

On Mar 2, 7:11*pm, steve wrote:
Dear All,

Can you have a look at this and please tell why it doesnt work

Sub CopySheetAsHTML()

Dim fName As String
Dim wks As Worksheet

Set wks = ActiveSheet
fName = wks.Range("J4").Value

With ActiveWorkbook.PublishObjects.Add(xlSourceSheet, _
* * "I:\" & fName & ".htm", wks.Name, "DataRange", _
* * * * xlHtmlStatic, wks.Range("J4").Value)
* * .Publish (True)
End With
End Sub

Many Thanks in advance

Steve


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
Why doesnt my filter work!!!!! law Excel Discussion (Misc queries) 2 December 3rd 07 07:48 PM
reference to other sheet doesnt work Jan Excel Worksheet Functions 3 August 21st 06 08:48 PM
COUNTIF doesnt work! jjj Excel Worksheet Functions 2 September 30th 05 02:38 AM
sum totaling doesnt work Bedros Excel Worksheet Functions 1 July 6th 05 04:15 AM
Formula doesnt work Kevin Excel Worksheet Functions 2 February 24th 05 12:57 AM


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

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"