Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.links,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default How to get rid of web page objects ?

Hi,

I often need to copy some data from internet home page for further
processing e.g. list of computer hardware components listed as table in
various web sites. It's easy by just highlighting the concerned area in
opened html file then use windows copy & paste function to paste them
into opened excel worksheet. However the problem begins. Such copy &
paste action will not only copy text, but all other objects e.g. check
boxes, gif icons, embedded hypertext links to excel worksheet.

To remove them all, I need to goto each cell, point the mouse to these
objects / links then press right mouse button and select cut / remove
hyperlink which is a tedious job.

Are there more efficient ways to get rid of these not needed objects /
links ?

Tks :(

  #2   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default How to get rid of web page objects ?

Try this:

Select only one cell

Press the [F5] key.........that's the shortcut for <edit<go to
Click the [Special] button
Check: Objects
Click the [OK] button

That should select all the scrap objects that came from the web page.
Press the [delete] key to remove them.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"come_mon_come_mon!" wrote:

Hi,

I often need to copy some data from internet home page for further
processing e.g. list of computer hardware components listed as table in
various web sites. It's easy by just highlighting the concerned area in
opened html file then use windows copy & paste function to paste them
into opened excel worksheet. However the problem begins. Such copy &
paste action will not only copy text, but all other objects e.g. check
boxes, gif icons, embedded hypertext links to excel worksheet.

To remove them all, I need to goto each cell, point the mouse to these
objects / links then press right mouse button and select cut / remove
hyperlink which is a tedious job.

Are there more efficient ways to get rid of these not needed objects /
links ?

Tks :(


  #3   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default How to get rid of web page objects ?

Using VBA:

Cells.Hyperlinks.Delete
ActiveSheet.Pictures.Delete
--
Gary's Student


"Ron Coderre" wrote:

Try this:

Select only one cell

Press the [F5] key.........that's the shortcut for <edit<go to
Click the [Special] button
Check: Objects
Click the [OK] button

That should select all the scrap objects that came from the web page.
Press the [delete] key to remove them.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"come_mon_come_mon!" wrote:

Hi,

I often need to copy some data from internet home page for further
processing e.g. list of computer hardware components listed as table in
various web sites. It's easy by just highlighting the concerned area in
opened html file then use windows copy & paste function to paste them
into opened excel worksheet. However the problem begins. Such copy &
paste action will not only copy text, but all other objects e.g. check
boxes, gif icons, embedded hypertext links to excel worksheet.

To remove them all, I need to goto each cell, point the mouse to these
objects / links then press right mouse button and select cut / remove
hyperlink which is a tedious job.

Are there more efficient ways to get rid of these not needed objects /
links ?

Tks :(


  #4   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default How to get rid of web page objects ?


Ron Coderre 寫道:

Try this:

Select only one cell

Press the [F5] key.........that's the shortcut for <edit<go to
Click the [Special] button
Check: Objects
Click the [OK] button

That should select all the scrap objects that came from the web page.
Press the [delete] key to remove them.

Does that help?


It works for those gif icons, not for the check boxes or hyperlinks :/

***********
Regards,
Ron

XL2002, WinXP


  #5   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default How to get rid of web page objects ?


Gary''s Student 寫道:

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 :)



  #6   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
zz zz is offline
external usenet poster
 
Posts: 32
Default How to get rid of web page objects ?

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 寫道:

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 :)


  #7   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
zz zz is offline
external usenet poster
 
Posts: 32
Default How to get rid of web page objects ?

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 寫道:

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 :)




  #8   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default How to get rid of web page objects ?


zz 寫道:

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"

  #9   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
zz zz is offline
external usenet poster
 
Posts: 32
Default How to get rid of web page objects ?

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 寫道:

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"


  #10   Report Post  
Posted to microsoft.public.excel.links,microsoft.public.excel.misc,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default How to get rid of web page objects ?


zz 寫道:

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
page break problem Lisa Excel Discussion (Misc queries) 2 March 5th 06 02:22 PM
Page scaling & Page break preview prob Martin 忽帕 @REMOVETHIS.plus.com Excel Discussion (Misc queries) 1 July 17th 05 09:10 PM
Can't delete a page break Suhail Excel Discussion (Misc queries) 4 July 7th 05 06:49 PM
page break preview VickiJo Excel Discussion (Misc queries) 1 June 10th 05 04:12 PM
excel 2003 page numbering art Excel Worksheet Functions 3 December 8th 04 10:49 PM


All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"