G
Gerencsér Gábor
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
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