Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking Excel files on a website? 1

Status
Not open for further replies.

mozingod

MIS
Jul 9, 2002
227
US
I'm woundering if there is any way to "link" an Excel spreadsheet to a web site? So if there's a report stored on a share, can I make it so visitors can open the report without having to download and without needing the author to publish it, but updated whenever the spreadsheet is saved? This is for an intranet webpage, so everyone has Excel loaded and is running IE5+ if that helps at all. Also, the spreadsheets in question are all stored on the webserver already. Any help would be greatly appreciated!!

Darrell Mozingo
 
Hello, everybody.

We are using an automatic conversion of Excel and Word files into webpages too.

As i see, doubleG123, you are using a similiar solution as we do. May be you have a solution for a little problem that we still have:

When i save a word or excel document that contains headers and footers to html, i get a file 'header.htm' which contains the header AND the footer of the original document.

What i need is a header.htm and a footer.htm so i can show header, body and footer in a framebased webpage. It even would be enough, if i got an all-in-one-file (with all parts, header, body, footer in it).

Sorry for interrupting your discussion, but maybe this could be interesting for others too.

With regards,
Rolf Tieben
 
Hi All
I've been following this saga with lots of interest.

Rolf
You could try the following as a partial solution for an Excel file with a header:

In the Workbook_Close event coding
1 Save the workbook (as an Excel file)
2 Remove headers
3 Insert new Row 1 on each worksheet
4 Enter same information on Row 1 as was previously in the header
5 Publish file as .htm
6 Close Excel file without saving

You can get the syntax for lines 2 to 4 right by recording.

Sorry but I don't know how to do it with Word or Excel footers.

Roger
 
Thank you for your tip Roger, but i think there must be a more simple solution.

By looking through the generated htm-files i mentioned that there must be a possibility to build a proper framework by using this files.

There are defined styles and divisions in the header.htm file (<style>... id=h1 for header id=f1 for footer) which are also listed in the 'body-file'.

In the case of a converted word-file, ms-word is able to reconstruct header, body and footer correct, as i open the htm-file that contains the body data.

So i think it's a matter of building a correct frame/stylesheet construction.

The problem is, that i have no idea what it has to look like.

Maybe someone else does ?

Another way could be to copy header.htm to a file footer.htm and remove the footer parts in header.htm:

<div style=&quot;mso-element:footer' id=f1>
...
</div>

and the header-parts in footer.htm

<div style=&quot;mso-element:header' id=h1>
...
</div>

with a script (PERL) and build a 'normal' framework.

Regards, Rolf
 
Galen:

I finally got it! The code that did it for me was:

ActiveWorkbook.PublishObjects.Add(xlSourceSheet, &quot;C:\Inetpub\ _
&quot;2003 Schedule Accomplishment&quot;, Title:=&quot;Schedule Accomplishment&quot;, HtmlType:=xlHtmlStatic).Publish True

Don't ask me why it finally works, but I'm glad it does. Thank you sooo much for all your help!

Darrell Mozingo
 
First of all, Congratulations to Darrell! Glad you got it to work.

Second of all, Hi Rolf:

If you take a look at the Objects in Word (using the Object Browser), you can reference each of the Headers and Footers separately, then save them individually as the Header.htm and Footer.htm files as you see fit. It makes sense to me to call the headers and footers by the same name as the main document followed by the header or footer designation. That way it will be easier to debug at later dates.

You'll see that you can reference the Header and Footer Objects separately as in:

Code:
With ActiveDocument.Sections(1)
    .Headers(wdHeaderFooterPrimary).Range.Text = &quot;Header text&quot;
    .Footers(wdHeaderFooterPrimary).Range.Text = &quot;Footer text&quot;
End With

In much the same way, you should be able to parse out the Header and Footer sections of each page in the collection of pages and save them independently as your Header and Footer files.htm that you need for your frames.

You might run into some errors if there is no header on one or more of the pages, but that should be simple -- just write the code so that it references the &quot;exists&quot; property of the HeadersFooters object before performing the actions to save them as individual htm files.

Code:
If ThisDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Exists Then 'process your actions after this...
Else ' Move on to the next item in the collection and start the Header/Footer parsing procedure all over again

You should be good to go from there. Good luck!


-Galen
(DoubleG123)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top