Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default web box address

Hi how do I return a web browser address into a cell as per the following
example??


Cells(ActiveCell.Row, "ar").Value = ActiveSheet.Shapes("WebBrowser2").Address
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default web box address

You have a few problems with the code below

1) A shape doesn't have an address. the location of the shape is determined
by 4 parameters which are points (or pixels) position.

left, top, width, height

2) If you have an Oleobject like a textbox, listbox, checkbox they have both
shape information and object information. The data inside the items will be
the Oleobjects.object while the picture type information will be shapes.

ActiveSheet.Oleobjects("WebBrowser2").object.Text - if item was a textbox

"Atishoo" wrote:

Hi how do I return a web browser address into a cell as per the following
example??


Cells(ActiveCell.Row, "ar").Value = ActiveSheet.Shapes("WebBrowser2").Address

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default web box address

sorry i should have been more specific!
i meant the web address that the web box is currently viewing.

"Joel" wrote:

You have a few problems with the code below

1) A shape doesn't have an address. the location of the shape is determined
by 4 parameters which are points (or pixels) position.

left, top, width, height

2) If you have an Oleobject like a textbox, listbox, checkbox they have both
shape information and object information. The data inside the items will be
the Oleobjects.object while the picture type information will be shapes.

ActiveSheet.Oleobjects("WebBrowser2").object.Text - if item was a textbox

"Atishoo" wrote:

Hi how do I return a web browser address into a cell as per the following
example??


Cells(ActiveCell.Row, "ar").Value = ActiveSheet.Shapes("WebBrowser2").Address

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default web box address

this will work. I'm not sure how to direrctly get the combox from the
command bar because it doesn't have a name. It is item 10 in my workbook but
not sure if that will always be the same item. You can also get all the web
addresses from the combobox if you need them.


Set WebBar = Application.CommandBars("Web").Controls
For Each Item In WebBar
If Item.Type = msoControlComboBox Then
webaddress = Item.Text
End If

Next Item

"Atishoo" wrote:

sorry i should have been more specific!
i meant the web address that the web box is currently viewing.

"Joel" wrote:

You have a few problems with the code below

1) A shape doesn't have an address. the location of the shape is determined
by 4 parameters which are points (or pixels) position.

left, top, width, height

2) If you have an Oleobject like a textbox, listbox, checkbox they have both
shape information and object information. The data inside the items will be
the Oleobjects.object while the picture type information will be shapes.

ActiveSheet.Oleobjects("WebBrowser2").object.Text - if item was a textbox

"Atishoo" wrote:

Hi how do I return a web browser address into a cell as per the following
example??


Cells(ActiveCell.Row, "ar").Value = ActiveSheet.Shapes("WebBrowser2").Address

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default web box address

Is there no way to just return the web address in a cell?? i know how to set
the web address using navigate2! surely there must be a way to return the
address just as you would an objects value? then again maybe there isnt?

"Joel" wrote:

this will work. I'm not sure how to direrctly get the combox from the
command bar because it doesn't have a name. It is item 10 in my workbook but
not sure if that will always be the same item. You can also get all the web
addresses from the combobox if you need them.


Set WebBar = Application.CommandBars("Web").Controls
For Each Item In WebBar
If Item.Type = msoControlComboBox Then
webaddress = Item.Text
End If

Next Item

"Atishoo" wrote:

sorry i should have been more specific!
i meant the web address that the web box is currently viewing.

"Joel" wrote:

You have a few problems with the code below

1) A shape doesn't have an address. the location of the shape is determined
by 4 parameters which are points (or pixels) position.

left, top, width, height

2) If you have an Oleobject like a textbox, listbox, checkbox they have both
shape information and object information. The data inside the items will be
the Oleobjects.object while the picture type information will be shapes.

ActiveSheet.Oleobjects("WebBrowser2").object.Text - if item was a textbox

"Atishoo" wrote:

Hi how do I return a web browser address into a cell as per the following
example??


Cells(ActiveCell.Row, "ar").Value = ActiveSheet.Shapes("WebBrowser2").Address



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 267
Default web box address

tried that last code and it seems to return the address of the whole excell
file (c:\folder\epb.xls) rather than the web page address

"Atishoo" wrote:

Is there no way to just return the web address in a cell?? i know how to set
the web address using navigate2! surely there must be a way to return the
address just as you would an objects value? then again maybe there isnt?

"Joel" wrote:

this will work. I'm not sure how to direrctly get the combox from the
command bar because it doesn't have a name. It is item 10 in my workbook but
not sure if that will always be the same item. You can also get all the web
addresses from the combobox if you need them.


Set WebBar = Application.CommandBars("Web").Controls
For Each Item In WebBar
If Item.Type = msoControlComboBox Then
webaddress = Item.Text
End If

Next Item

"Atishoo" wrote:

sorry i should have been more specific!
i meant the web address that the web box is currently viewing.

"Joel" wrote:

You have a few problems with the code below

1) A shape doesn't have an address. the location of the shape is determined
by 4 parameters which are points (or pixels) position.

left, top, width, height

2) If you have an Oleobject like a textbox, listbox, checkbox they have both
shape information and object information. The data inside the items will be
the Oleobjects.object while the picture type information will be shapes.

ActiveSheet.Oleobjects("WebBrowser2").object.Text - if item was a textbox

"Atishoo" wrote:

Hi how do I return a web browser address into a cell as per the following
example??


Cells(ActiveCell.Row, "ar").Value = ActiveSheet.Shapes("WebBrowser2").Address

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
How do I avoid excel change absolute address to relative address Miguel Excel Discussion (Misc queries) 3 May 10th 07 11:18 PM
long address list, name-address-city, listed vertically, how do y. kb Excel Discussion (Misc queries) 2 March 4th 05 12:48 AM
How do I import Office address book to Outlook Express address bo. snnorp Excel Discussion (Misc queries) 2 February 22nd 05 11:47 AM
How to insert an address from Outlook 2003 address book ? Dubois Excel Programming 0 September 27th 04 09:26 AM
LINKING Address cells from an EXCEL spreadsheet to fill MapQuest Address Info Duane S. Meyer Excel Programming 0 August 30th 03 12:16 AM


All times are GMT +1. The time now is 04:26 AM.

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

About Us

"It's about Microsoft Excel"