Cosmo
02-05-2009, 09:07 AM
This post is related to a thread I posted here: http://www.theofficeexperts.com/forum/showthread.php?t=10360
I'm having problems editing excel charts/graphs in PPT 2007; the charts don't retain the same size upon opening/closing. In some cases, the charts have been compressed so badly that they are ineligible.
I'm not sure if it's related to the fact that the charts were created in older versions of PPT (I get the message to convert them to 2007 when opening). The charts are updated in the field by my client's sales force via VBA in another presentation, so I need to make sure that the charts don't change when they edit them. I was going to try to record a macro while opening the charts to see if I could use code to convert the charts in the program, but found out that 2007 is unrecordable.:banghead:
I was thinking of checking the size of the graph before editing, and resetting it after editing, but I'm not sure if I can figure out the proper code to do this; does anyone have any suggestions on how I can keep the charts from changing, or restoring their attributes in my VBA code? Tis a massive amount of code in the presentation that does the updating, so I can't post the complete code, but all I'm doing to the charts is setting the data with this code:
With oShape
If TypeName(.OLEFormat.Object) = "Chart" Then
.OLEFormat.Object.Application.datasheet.Range(mColumn & mRow).Value = thePresentationValue
ElseIf TypeName(.OLEFormat.Object) = "Workbook" Then
.OLEFormat.Object.Sheets("Sheet1").Range(mColumn & mRow).Value = thePresentationValue
End If
Next oShape
and opening and closing the charts with this line when all of the data has been set (I found that if the charts weren't opened, the data wouldn't be retained after the presentation was saved and closed)
oShape.OLEFormat.DoVerb Index:=1
I'm having problems editing excel charts/graphs in PPT 2007; the charts don't retain the same size upon opening/closing. In some cases, the charts have been compressed so badly that they are ineligible.
I'm not sure if it's related to the fact that the charts were created in older versions of PPT (I get the message to convert them to 2007 when opening). The charts are updated in the field by my client's sales force via VBA in another presentation, so I need to make sure that the charts don't change when they edit them. I was going to try to record a macro while opening the charts to see if I could use code to convert the charts in the program, but found out that 2007 is unrecordable.:banghead:
I was thinking of checking the size of the graph before editing, and resetting it after editing, but I'm not sure if I can figure out the proper code to do this; does anyone have any suggestions on how I can keep the charts from changing, or restoring their attributes in my VBA code? Tis a massive amount of code in the presentation that does the updating, so I can't post the complete code, but all I'm doing to the charts is setting the data with this code:
With oShape
If TypeName(.OLEFormat.Object) = "Chart" Then
.OLEFormat.Object.Application.datasheet.Range(mColumn & mRow).Value = thePresentationValue
ElseIf TypeName(.OLEFormat.Object) = "Workbook" Then
.OLEFormat.Object.Sheets("Sheet1").Range(mColumn & mRow).Value = thePresentationValue
End If
Next oShape
and opening and closing the charts with this line when all of the data has been set (I found that if the charts weren't opened, the data wouldn't be retained after the presentation was saved and closed)
oShape.OLEFormat.DoVerb Index:=1