Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Save as web page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
richzip - 25 Mar 2008 03:46 GMT
I am using macro code to generate multiple workbooks from data in one large
workbook.  After the individual workbooks are generated, they are each saved
with a unique file name.  

How can I change the code to have it save in .htm format?  The code I'm
currently using is below.  I tried changing "FileExStr" to .htm, but that
doesn't work.  I'm assuming I need a new file format, and tried searching
online but can't find it anywhere.  Any suggestions?

Thanks!
Else
       'You use Excel 2007
       If ws1.Parent.FileFormat = 56 Then
           FileExtStr = ".xls": FileFormatNum = 56
       Else
           FileExtStr = ".xlsx": FileFormatNum = 51
       End If

then further down ..
'Save the file in the new folder and close it
           WBNew.SaveAs foldername & " Value = " _
                        & cell.Value & FileExtStr, FileFormatNum
           WBNew.Close False
Jim Rech - 25 Mar 2008 12:22 GMT
Press F1 in the VBE for Help and search on Workbook "SaveAs".  This will
lead to a page that has all the file format constants:

http://office.microsoft.com/client/helppreview.aspx?AssetID=HV100724461033&ns=EX
CEL.DEV&lcid=1033


You're interested in xlHtml which you should use instead of its literal
value 44.

Signature

Jim

|I am using macro code to generate multiple workbooks from data in one large
| workbook.  After the individual workbooks are generated, they are each saved
[quoted text clipped - 19 lines]
|                         & cell.Value & FileExtStr, FileFormatNum
|            WBNew.Close False
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.