Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() Gary''s Student ¼g¹D¡G Using VBA: Cells.Hyperlinks.Delete ActiveSheet.Pictures.Delete -- Gary's Student YEAH !!! IT WORKS WITH URL LINKS !!!!! NOW ONLY THE CHECK BOXES WERE LEFT REMAINED UNCLEARED :) |
#2
![]()
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
try this code
but be advised, it deletes any Ole object inserted in the sheet, it doesn't matter wath type is it here's the code Private Sub deleteobjects() Dim s As Sheet1 Set s = ActiveSheet Dim olObj As OLEObject With s For Each olObj In .OLEObjects ..OLEObjects(.OLEObjects.Count).Delete Next End With set s= nothing set OlObj=nothing End Sub -- hope this works! --- zz [MX] cuasi-musico,semi-poeta y loco "come_mon_come_mon!" wrote in message ups.com... Gary''s Student ¼g¹D¡G Using VBA: Cells.Hyperlinks.Delete ActiveSheet.Pictures.Delete -- Gary's Student YEAH !!! IT WORKS WITH URL LINKS !!!!! NOW ONLY THE CHECK BOXES WERE LEFT REMAINED UNCLEARED :) |
#3
![]()
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
this is an improved version of the previous code, now it "cleans" the sheet
of anything but text. Private Sub deleteobjects() Dim s As Worksheet, chrt As ChartObject, shp As Shape Set s = ActiveSheet Dim olObj As OLEObject With s For Each shp In .Shapes ..Shapes(.Shapes.Count).Delete Next For Each chrt In ChartObjects ..ChartObjects(.ChartObjects.Count).Delete Next For Each olObj In .OLEObjects ..OLEObjects(.OLEObjects.Count).Delete Next End With Set s = Nothing Set olObj = Nothing Set chrt = Nothing Set shp = Nothing End Sub -- --- zz [MX] cuasi-musico,semi-poeta y loco "zz" wrote in message ... try this code but be advised, it deletes any Ole object inserted in the sheet, it doesn't matter wath type is it here's the code Private Sub deleteobjects() Dim s As Sheet1 Set s = ActiveSheet Dim olObj As OLEObject With s For Each olObj In .OLEObjects .OLEObjects(.OLEObjects.Count).Delete Next End With set s= nothing set OlObj=nothing End Sub -- hope this works! --- zz [MX] cuasi-musico,semi-poeta y loco "come_mon_come_mon!" wrote in message ups.com... Gary''s Student ¼g¹D¡G Using VBA: Cells.Hyperlinks.Delete ActiveSheet.Pictures.Delete -- Gary's Student YEAH !!! IT WORKS WITH URL LINKS !!!!! NOW ONLY THE CHECK BOXES WERE LEFT REMAINED UNCLEARED :) |
#4
![]()
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() zz ¼g¹D¡G this is an improved version of the previous code, now it "cleans" the sheet of anything but text. Private Sub deleteobjects() Dim s As Worksheet, chrt As ChartObject, shp As Shape Set s = ActiveSheet Dim olObj As OLEObject With s For Each shp In .Shapes .Shapes(.Shapes.Count).Delete Next For Each chrt In ChartObjects .ChartObjects(.ChartObjects.Count).Delete Next For Each olObj In .OLEObjects .OLEObjects(.OLEObjects.Count).Delete Next End With Set s = Nothing Set olObj = Nothing Set chrt = Nothing Set shp = Nothing End Sub I put the above code into Excel macro sub. It ran and deleted objects but it also returned error "424 object needed here". Debugger pointed at the line "For Each olObj In .OLEObjects" |
#5
![]()
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Not repro!!
but try this correction as well it can be caused by the OlObj being setted to nothing at the end of the code Private Sub deleteobjects() Dim s As Worksheet, chrt As ChartObject, shp As Shape Set s = ActiveSheet Dim olObj As OLEObject With s For Each shp In .Shapes .Shapes(.Shapes.Count).Delete Next For Each chrt In ChartObjects .ChartObjects(.ChartObjects.Count).Delete Next For Each olObj In .OLEObjects .OLEObjects(.OLEObjects.Count).Delete Next End With Set s = Nothing err.clear Set olObj = Nothing Set chrt = Nothing Set shp = Nothing End Sub -- --- zz [MX] cuasi-musico,semi-poeta y loco "come_mon_come_mon!" wrote in message oups.com... zz ¼g¹D¡G this is an improved version of the previous code, now it "cleans" the sheet of anything but text. Private Sub deleteobjects() Dim s As Worksheet, chrt As ChartObject, shp As Shape Set s = ActiveSheet Dim olObj As OLEObject With s For Each shp In .Shapes .Shapes(.Shapes.Count).Delete Next For Each chrt In ChartObjects .ChartObjects(.ChartObjects.Count).Delete Next For Each olObj In .OLEObjects .OLEObjects(.OLEObjects.Count).Delete Next End With Set s = Nothing Set olObj = Nothing Set chrt = Nothing Set shp = Nothing End Sub I put the above code into Excel macro sub. It ran and deleted objects but it also returned error "424 object needed here". Debugger pointed at the line "For Each olObj In .OLEObjects" |
#6
![]()
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() zz ¼g¹D¡G Not repro!! but try this correction as well it can be caused by the OlObj being setted to nothing at the end of the code Private Sub deleteobjects() Dim s As Worksheet, chrt As ChartObject, shp As Shape Set s = ActiveSheet Dim olObj As OLEObject With s For Each shp In .Shapes .Shapes(.Shapes.Count).Delete Next For Each chrt In ChartObjects .ChartObjects(.ChartObjects.Count).Delete Next For Each olObj In .OLEObjects .OLEObjects(.OLEObjects.Count).Delete Next End With Set s = Nothing err.clear Set olObj = Nothing Set chrt = Nothing Set shp = Nothing End Sub -- --- zz [MX] cuasi-musico,semi-poeta y loco Sorry, same error message came out at line "For Each chrt In ChartObjects". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
page break problem | Excel Discussion (Misc queries) | |||
Page scaling & Page break preview prob | Excel Discussion (Misc queries) | |||
Can't delete a page break | Excel Discussion (Misc queries) | |||
page break preview | Excel Discussion (Misc queries) | |||
excel 2003 page numbering | Excel Worksheet Functions |