|
-
Aug 17th, 2000, 10:27 AM
#1
Thread Starter
New Member
I want to be able to cope a cell out of an excel spreadsheet into the URL window of a browser.
Having trouble making the URL line the target of my paste.
Thanks in advance!
Ray
-
Aug 17th, 2000, 10:43 AM
#2
Fanatic Member
try using DDE or create your own instance of ie use ShDocVw. or what ever thats called, then just use the navigate method. Will post code if wanted.
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Aug 17th, 2000, 10:48 AM
#3
Thread Starter
New Member
Would appreciate
The code if you could VERY new to VB, the jump start would be helpful.
My e-mail is [email protected] if that is easier.
thanks,
Ray
-
Aug 17th, 2000, 10:53 AM
#4
Fanatic Member
OK, do you want me to post the code to access excel too, if so, do all the PC in question have excel installed?
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Aug 17th, 2000, 12:01 PM
#5
Thread Starter
New Member
yes all machines have excel installed
-
Aug 17th, 2000, 12:03 PM
#6
Thread Starter
New Member
and
yes the code to access excel would be helpful,
thanks so much
Ray
-
Aug 17th, 2000, 12:20 PM
#7
Fanatic Member
OK, here it is!
Add a Referance to the Microsoft Excel Object Library v. (9 for excel 2000, 8 for excel 97, etc.)
and to the Microsoft Internet Conrols (Make sure you add a Referance, not Componet)
Code:
'paste this into a .bas module
Public Sub ExcelToURL()
Dim x As Excel.Application 'excel object
Dim objSheet As Excel.Worksheet 'sheet object
Dim ie As New InternetExplorer 'internet explorer object
Dim strURL As String 'url
Set x = CreateObject("Excel.Application") 'create an invisible instance of excel
Set objSheet = x.Workbooks.Open(App.Path & "\MyXls.xls").ActiveSheet 'your path goes here, open your file
strURL = objSheet.Cells(1, 1).Value 'Cell A1, get right cell's value
x.ActiveWorkbook.Close 'close workbook
x.Quit 'exit excel
Set objSheet = Nothing 'clear memory
Set x = Nothing
ie.Navigate strURL 'goto webpage
ie.Visible = True 'show ie
Set ie = Nothing 'clear memory
End Sub
Now, change the file path and the cell to what you want
Code:
'to use
Call ExcelToURL
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|