Thread: Print Macros
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Print Macros

Sub CommandButton1()
Dim objShell as Object, objFolder as Object
Dim strDeskPath as String
Const Desktop = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(Desktop)
strDeskPath = objFolder.Self.Path
worksheets("Sheet3").copy
Application.DisplayAlerts = False
activeworkbook.SaveAs strDeskPath & "\" & "Mybooks.xls"
Activeworkbook.Close SaveChanges:=False
end sub

--
Regards,
Tom Ogilvy

"WBTKbeezy" wrote:

I'm trying to create a button that will automatically print out a sheet to my
desktop (or possibly another folder) with a specific filename (say, Vendor A)
without having to type anything in... Basically press a button and my file is
ready to go without any intervention... any help out there?