Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-20-2011, 05:12 PM
malfromcessnock malfromcessnock is offline HyperLink help please Windows XP HyperLink help please Office 2007
Novice
HyperLink help please
 
Join Date: Dec 2011
Posts: 8
malfromcessnock is on a distinguished road
Default

Thank you Catlin B for your script - but you're gonna laugh I suppose...



but, where do I put it

Cheers, Mal
Reply With Quote
  #2  
Old 12-20-2011, 11:09 PM
Catalin.B Catalin.B is offline HyperLink help please Windows Vista HyperLink help please Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Press alt+F11 to open Visual Basic Editor, on the left side, you will see VBA Project(your file name.xlsx), right click on it, insert new module, then on the right side of the window, paste the codes below.
Activate macro: Excel 2007-2010: press Microsoft Office Button , then click Excel Options. In Trust Center category, click on Trust Center Settings, then click on category Macro Settings.(recomended option- Medium).This way, excel will ask for your permission to activate macro for that file.
As you can see , there are two macros, one will open all file types, the second will open only excel files. Macros:
Code:
Option Explicit
Sub search()
Dim vFile As Variant, MyPath As String
MyPath = ThisWorkbook.Path 'replace with your desired path
CreateObject("WScript.Shell").CurrentDirectory = MyPath
       ChDir MyPath
       'for all files type
       vFile = Application.GetOpenFilename()
End Sub

Sub search2()
Dim vFile As Variant, MyPath As String
MyPath = "\\Flory\D\" 'replace with your desired path
CreateObject("WScript.Shell").CurrentDirectory = MyPath
       ChDir MyPath
'for excel files only
       vFile = Application.GetOpenFilename("Excel Files (*.xl*)," & _
      "*.xl*", 1, "Select Excel File", "Open", False)
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
HyperLink help please Hyperlink Mahmuz Word 2 05-04-2011 10:59 AM
Followed hyperlink question dth122 PowerPoint 0 06-06-2010 07:15 PM
Hyperlink Warning gfkbob Outlook 0 01-23-2010 06:50 AM
Hyperlink ltvjim Outlook 0 03-28-2007 10:28 AM
hyperlink scuba32 Word 0 08-24-2006 07:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft