Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Open other applications using code

I want to have Excel open Windows Explorer to a specific drive location, ie
C:\MyFolder.
I also want Excel to open Internet Explorer to a specific intranet site.
Can either of these actions be done thru Excel VB?

Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Open other applications using code

I am assuming that you want to import and Excel file into an existing
worksheet. Is that right?
Sub Import()
Dim Wb1 As Workbook
Dim Wb2 As Workbook
Dim x As Long
Dim FilesToOpen


FilesToOpen = Application.GetOpenFilename _
(FileFilter:="Text Files (*.xls), *.xls", _
MultiSelect:=True, Title:="Excel Files to Open")

Set Wb1 = ActiveWorkbook
For x = LBound(FilesToOpen) To UBound(FilesToOpen)
Set Wb2 = Workbooks.Open(Filename:=FilesToOpen(x))

Wb2.Worksheets.Copy _
After:=Wb1.Sheets(Wb1.Sheets.Count)

Wb2.Close False
Next x

'Sheets("Control Sheet").Select
End Sub

Next, turn on the macro recorder, click Data Import External data New
Web Query. Then, type any URL into the address bar. Search around until you
find what you want, click the little yellow arrow (next to the data that you
want to import) and it will turn into a green check box. Finally, click on
the 'Import' button in the lower right hand side of the active window.

I did this and got the code below:
Sub Macro1()

With
ActiveSheet.QueryTables.Add(Connection:="URL;http://finance.yahoo.com", _
Destination:=Range("A1"))
.Name = "finance.yahoo"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

Regards,
Ryan---


--
RyGuy


"SJW_OST" wrote:

I want to have Excel open Windows Explorer to a specific drive location, ie
C:\MyFolder.
I also want Excel to open Internet Explorer to a specific intranet site.
Can either of these actions be done thru Excel VB?

Thanks for any help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Open other applications using code

On Aug 6, 9:02*am, SJW_OST wrote:
I want to have Excel open Windows Explorer to a specific drive location, ie
C:\MyFolder.
I also want Excel to open Internet Explorer to a specific intranet site.
Can either of these actions be done thru Excel VB?

Thanks for any help.


All these can be done.

u can use

Sub test()
ActiveWorkbook.FollowHyperlink Address:="H:\", _
NewWindow:=True
End Sub


IF you go to the webpage of say google then just use

Sub test()
ActiveWorkbook.FollowHyperlink Address:="http://www.google.com", _
NewWindow:=True
End Sub
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
Why does Exel open much slower than other applications? Andre Excel Discussion (Misc queries) 0 March 24th 09 08:37 PM
Can't open Excel files from other applications Paul Excel Discussion (Misc queries) 1 February 10th 09 01:43 PM
Open non MS applications Frankie Excel Programming 4 August 23rd 06 12:04 AM
check Open Excel applications Zurn[_56_] Excel Programming 0 May 8th 06 07:29 AM
Macro to open other applications Sherry Excel Programming 2 October 1st 04 10:50 PM


All times are GMT +1. The time now is 06:54 PM.

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

About Us

"It's about Microsoft Excel"