Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help Please. How to save multiple html files (sounds easy but scenario causing confli


Hello Group!
Here is my scenario. I use third party software to dump data (running
every hr) into excel. The following code works fine as far as saving
file as an html with time stamp;

ChDir "C:\SFC\Archived\"
ActiveWorkbook.SaveAs Filename:="C:\SFC\Archived\" & fname &
"_chem" & ".html", FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=False

It works fine by saving file as 03-24-06_chem.html. Now when I used the
next code after the above code to save same excel file with given name
as an html;

ChDir "C:\SFC\" 'default directory for chem 7 days

ActiveWorkbook.SaveAs Filename:="C:\SFC\chem-gas.html",
FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=False

It does save the file as chem-gas.html but dropping the new data.

Here what i tried;

I tried saving file;

ActiveWorkbook.Save before running the above codes. Didn’t work.
Since the excel has graph, i have to have FileFormat:=XLHtml. It does
create a foler with all gif files in it.

I was wondering some how if I can save both files by using the first
code than i might not loss the data for the second file creation.


Here is my complete macro coding;

Sub chem7day()


Dim newSecond
Dim fname As String
Dim i As Long

fname = Format(Date, "yyyy-mm-dd")
newSecond = Second(Now()) + 60 'Time Delay


Calculate 'Calculating all
sheets including updating charts with new data
ActiveWorkbook.Save 'Saving file as an
Excel format



Sheets("2006").Select 'Before saving file the
main sheet should be default
Range("A2").Select 'Placing cursor to
upper left


If Weekday(Date) = 5 Then 'Condition to save
file every Wednesday



ChDir "C:\SFC\Archived\"
ActiveWorkbook.SaveAs Filename:="C:\SFC\Archived\" & fname &
"_chem" & ".html", FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=False
'If condition true than saving file with current date with addition
file name


‘The following code saving the file but without new data

ChDir "C:\SFC\" 'default directory for chem 7 days

ActiveWorkbook.SaveAs Filename:="C:\SFC\chem-gas.html",
FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=False




Else



ChDir "C:\SFC\" 'default directory for chem 7 days

ActiveWorkbook.SaveAs Filename:="C:\SFC\chem-gas.html",
FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=Fal 'If this
condition true than saving file as an html with given name




End If
End Sub


--
sam76210
------------------------------------------------------------------------
sam76210's Profile: http://www.excelforum.com/member.php...o&userid=20885
View this thread: http://www.excelforum.com/showthread...hreadid=526159

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
save rows as html files Lakewoodsale Excel Discussion (Misc queries) 0 December 24th 07 05:40 PM
Change Format from Number to Percentage (sounds easy enough) Mike C Excel Worksheet Functions 2 October 12th 07 01:06 PM
Combining multiple Excel files into one html? rjamison Excel Programming 0 June 14th 05 12:14 AM
Combining multiple Excel files into one html? rjamison Excel Programming 0 June 14th 05 12:14 AM
Combining multiple Excel files into one html? quartz[_2_] Excel Programming 9 April 21st 05 02:10 AM


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