Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
Hitting a CommandButton I would like to have the Print_Area on my sheet in MyWorkbook.xls saved as MyWorkbook2006-02-09.gif. (Unfortunately I don't have Adobe acrobat to make .pdf.) For some reason the code below just does not work and I cannot fix it. I would appreciate some advise. I am working in Excel2003 Sub SaveRangeAsGIF() Dim strDate As String Dim MyPath, MyName, MyFullName, MyPathName MyPath = Application.ActiveWorkbook.Path MyName = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) strDate = Format(Date, "yyyy-mm-dd") MyFullName = MyName & "-" & strDate & ".gif" MyPathName = ThisWorkbook.Path & "\" & MyName & "-" & strDate & ".gif" Response = MsgBox("Do you want to save the Print_Area as " & MyFullName, vbYesNo, "GIFmaker") If Response = vbYes Then Range("Print_Area").Export FileName:=MyPathName, FilterName:="GIF" End If End Sub Gabor |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save a Range on a Workbook as a CSV File | Excel Discussion (Misc queries) | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Using interop.excel to open a workbook, the workbook doesn't ask to save changes. | Excel Programming | |||
Save range from one workbook to a new workbook | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |