+ Reply to Thread
Results 1 to 2 of 2

Publish active sheet as static web page

Hybrid View

  1. #1
    Registered User
    Join Date
    08-01-2005
    Posts
    2

    Publish active sheet as static web page

    When I record a macro for publishing a sheet, I get this:

    Sub Macro2()
    '
    ' Macro2 Macro
    ' Macro to save active sheet as static web page
    '
    '
    With ActiveWorkbook.PublishObjects.Add(xlSourcePrintArea, _
    "D:\Documents and Settings\My Documents\Schedule.htm", _
    "August", "", xlHtmlStatic, "Schedule_2005_16684", "")
    .Publish (True)
    .AutoRepublish = False
    End With
    End Sub

    How do I get this to work on the active sheet, regardless of what it's name is?
    The workbook name is Schedule_2005, so what do the numbers after that mean?

    Thanks for any and all help. I'm lost in this VBA stuff. Stellina

  2. #2
    Registered User
    Join Date
    08-01-2005
    Posts
    2

    Publishing to web

    This may be rough, but it works:

    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 8/1/2005 to publish active sheet and the next sheet (to right) as web pages.


    With ActiveWorkbook.PublishObjects.Add( _
    SourceType:=xlSourceRange, _
    Filename:="ftp://mysite.com/Current.htm", _
    Sheet:=ActiveSheet.Name, _
    Source:="A2:I55", _
    HtmlType:=xlHtmlStatic)
    .Publish (True)
    .AutoRepublish = False
    End With

    Dim i As Integer
    Dim intStart As Integer

    intStart = ActiveSheet.Index + 1

    For i = intStart To Worksheets.Count
    If Not Worksheets(i).Visible = xlHidden Then
    'Note: Could add "and Worksheets(i).Visible = xlVeryHidden to above
    Worksheets(i).Activate

    With ActiveWorkbook.PublishObjects.Add( _
    SourceType:=xlSourceRange, _
    Filename:= "ftp://mysite.com/Next.htm", _
    Sheet:=ActiveSheet.Name, _
    Source:="A2:I55", _
    HtmlType:=xlHtmlStatic)
    .Publish (True)
    .AutoRepublish = False
    End With
    Exit Sub
    End If
    Next i

    End Sub
    Last edited by Stellina; 08-02-2005 at 03:35 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1