Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DRE DRE is offline
external usenet poster
 
Posts: 1
Default Programming behind a button

I need to have a button in an execl file that when clicked
will save the modifications made and then save the file as
an html file on a server to be viewed as a web page. I
know that all you have to do is click "save as html" but
we don't want the users to have to learn to do that.

Thanks in advance for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Programming behind a button

One method would be to add the button to the tool bar. I believe Save to
Web has it's own button. This would need to be set on each PC or the file
would need code that would add the button when it is opened.

Another method would be to record a macro of you doing the key strokes and
then attach that maco to a button or shape. To record a macro, selecect
Tools, Macro, Record Macro, name it if you wish, record the keystrokes then
stop the recording by clicking on the square stop button. On your
worksheet, add a button, a shape or add a picture. Then right click on it
and select Assign Macro. Choose the macro you recorded and that should do
it.

FYI - this is the code that was created when I recorded the macro. Note
that this method "hard codes" the file name. If you want to prompt the user
for a new file name, you'll need some more code.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/18/2003 by John A Michl
'

'
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\John\My Documents\Book1.htm",
FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

Good luck
John Michl
www.johnmichl.com


"DRE" wrote in message
...
I need to have a button in an execl file that when clicked
will save the modifications made and then save the file as
an html file on a server to be viewed as a web page. I
know that all you have to do is click "save as html" but
we don't want the users to have to learn to do that.

Thanks in advance for any help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Programming behind a button

DRE,

The easy way is to "record" a macro to do exactly what you want.
Tools/Macro/Record New Macro
When done, use a CommandButton from the "Forms" menu
View/Toolbars/Forms
When you drag the button to your worksheet, you'll be promted to
assign a macro to it. Assign the one you just recorded.
Every time the user presses the button, it'll do exactly what you
recorded in the macro.

John

DRE wrote:

I need to have a button in an execl file that when clicked
will save the modifications made and then save the file as
an html file on a server to be viewed as a web page. I
know that all you have to do is click "save as html" but
we don't want the users to have to learn to do that.

Thanks in advance for any help.


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
Programming dim Excel Discussion (Misc queries) 7 November 16th 07 11:56 AM
vba programming biker man Excel Discussion (Misc queries) 1 August 28th 07 04:02 PM
Counting, command button and programming in VB ElFrodo Excel Discussion (Misc queries) 5 February 23rd 07 05:24 AM
Programming a "Save as..." command button within Excel DavidHawes Excel Discussion (Misc queries) 2 November 13th 06 02:48 PM
Programming help BB Excel Discussion (Misc queries) 3 December 5th 05 01:09 AM


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