Ja jeg kender godt til ctrl, men det der undrede mig var at jeg skulle bruge ctrl, når jeg kunne markerede én graf. Jeg forsøgte mig nemlig kun med én graf af gangen.
Problemet består måske i at jeg benytter en makro til at gemme graferne som et billede. Første billede ser sådan ud:
http://img123.imageshack.us/my.php?image=test1yx3.pngOg når jeg så gemmer og åbner filen igen, ser det nogen gange sådan ud:
http://img123.imageshack.us/my.php?image=test2pq2.pngJeg ved ikke om det har noget med min makro at gøre? Den ser således ud:
Option Explicit
Sub ExportChart()
' Export a selected chart as a picture
Const sSlash$ = "/"
Const sPicType$ = ".png"
Dim sChartName$
Dim sPath$
Dim sBook$
Dim objChart As ChartObject
On Error Resume Next
' Test if there are even any embedded charts on the activesheet
' If not, let the user know
Set objChart = ActiveSheet.ChartObjects(1)
If objChart Is Nothing Then
MsgBox "No charts have been detected on this sheet", 0
Exit Sub
End If
' Test if there is a single chart selected
If ActiveChart Is Nothing Then
MsgBox "You must select a single chart for exporting ", 0
Exit Sub
End If
Dim MySuggest As String
MySuggest = "apm_"
Start:
sChartName = Application.GetSaveAsFilename( _
InitialFileName:=MySuggest _
& ".png", fileFilter:="PNG Files (*.png), *.png")
' User presses "OK" without entering a name
If sChartName = Empty Then
MsgBox "You have not entered a name for this chart", , "Invalid Entry"
GoTo Start
End If
' Test for Cancel button
If sChartName = "False" Then
Exit Sub
End If
' If a name was given, chart is exported as a picture in the same
' folder location as their current file
sBook = ActiveWorkbook.Path
sPath = sChartName
ActiveChart.Export Filename:=sPath, FilterName:="PNG"
End Sub
Håber det hjælper lidt på det.