Open Excel File Location (path) In Explorer

Jul 18, 2013

I would like to have a macro button that will open the file location (path were the excel is stored) in MS explorer.

I found something like:

Sub ExplorePath()
Shell Environ("windir") & "Explorer.exe " & ActiveDocument.Path, vbMaximizedFocus
End Sub

But that give the error that an object is needed. Would that also work for MS Word?

View 4 Replies


ADVERTISEMENT

Excel 2010 :: How To Find And Select (not Open) A File In Explorer Using VBA

Dec 11, 2013

Two months ago our employer seriously limited the size of our mailboxes. We are "forced" to store emails as msg files on our network. PST archives are not allowed. This naturally sucks, as in Explorer you only have the file names and dates to look for that one particular email amongst hundreds (thousands) of msg files. I was able to compose a program in Excel 2010 that generates a list of msg files from a selected folder, together with metadata (sender, receiver, etc.) and so on.

In a test the program worked fine with 6,710 msg files I could post the code here, but the comments and many of the variable names are in Dutch (I never expected it to work in the first place). There is one thing I would like to add to the program. Sometimes I want to add an email to a new email as an attachment. Nowadays I have to look for the right msg file in Explorer by hand, which is a pitty, because I have the paths and filenames in my worksheet. I can put that in a string variable and let VBA do the looking up.

But I don't know how. I would like to be able to let VBA look for the file in Explorer, select it and then stop. I could then drag and drop the selected msg file in my new email. But all my attempts to find example code end up with code that enables a user to select a file and immediately open it. That is one step too far for me. If the msg file is opened, I cannot add it to a new email as an attachment anymore.

View 7 Replies View Related

Open Excel File From Unknown Path But Specify Name

Apr 27, 2014

How can I change this;

Code:
Sub GetData_Example4()
Dim SaveDriveDir As String, MyPath As String
Dim FName As Variant

SaveDriveDir = CurDir
MyPath = Application.DefaultFilePath 'or use "C:Data"

[Code] ....

So that it still prompts the user for the path but limits their selection to only Excel files and only those named 'Roles'?

View 7 Replies View Related

How To Create Userform In Excel To Open Particular File Location

May 22, 2013

I am working on a project where i am having 8 excel files saved at diffrent location so i want to create userform which will open particular file location and from that user can select the file which he want and then can go further. so i need a coding so that user will be prompt 8 times with file location. for eg. once user select particular file from location then again this code route him to select next file from file location. is it possible??

I tried using below code but in this code when i run userform file is not opening but when i run this code mannually by pressing F8 desired file is opening i dont know what is glitch in this ? another problem i am facing is not able to understand how to repeat this steps again to open another file using this code??

VB:
Private Sub Commandbutton1_Click()
Dim f As FileDialog
Set f = Application.FileDialog(msoFileDialogFilePicker)
With f

[Code]....

View 4 Replies View Related

Excel 2010 :: Save Open File Location?

Nov 26, 2012

I just got a new computer and upgraded to Excel 2010 and Windows 7. When I try to open a workbook in Excel 2010, my saved file paths on the left side of the screen are gone. I want to put them back in there.

In Excel 2007 running Windows XP, I would just right click in the left side menu and click "add" and now that's no longer an option.

View 1 Replies View Related

Find A File And Present Its Location (Path) In A MsgBox

Jun 5, 2006

I am looking for a VBA Code which will:

1. Search for a specific File.

The file will the same file (ABC.xls) BUT the user might want to change it by typing a new name & Extension in the first Inputbox.

2. A second InputBox (Drive & Path) should now Pop-up.

If it will be left empty - the search should take place throughout ALL the installed HDs.

If the user decides to minimize the search range he/she will type a Drive & Path, the search should reduce/constrain itself to the specific Path ONLY.

My task is to show its Path location in a MsgBox (or to show "file not found")

It might be a good idea if the code can be extended beyond presenting the Path to:
1. Open the Windows "Explorer" (or "My Computer") in the specific Path with the file being selected (marked).

2. Opening that file, in "Excel", upon finding it.

A 3 section, VBA, code will be more than appreciated.

View 9 Replies View Related

Change File Path Name In VBA Code Based On Files Location

Mar 11, 2014

I have the following code written but I'm wondering if it's possible to modify this to change the red line to update to the path that the workbook is saved in? Meaning that User1Folder1 would change but [Workbook1.xlsm]Sheet1'E1 would always be the same.

[Code] .......

View 2 Replies View Related

2 Instances Of 2007 Slow To Open A File By Double-clicking And Entering From Windows Explorer

Sep 20, 2007

i use excel 2007, it s slow to open a file by double-clicking and entering from windows explorer, by googling i fould a fix by adding "%1" at the end of command in "Application used to perform action" (folder options/file types/xls/advance/open). however, to open files in the same instance, i have to keep "DDE message" with [open("%1")]. With both "%1", excel now opens twice.
How to fix it?

View 3 Replies View Related

Automatically Open File In Specific File Path When Another Sheet Is Opened

Mar 20, 2014

I want to open a specific sheet and refresh only said sheet when i open another sheet for example x.xls

So opening x.xls will automatically open y.xls

I've tried this in the workbook code area but it doesn't do anything.

[Code] .....

View 1 Replies View Related

Excel Macro - Open Windows Explorer Window Using VBA?

Jun 6, 2002

What's the code for opening a Windows Explorer window from within an Excel Macro?

View 7 Replies View Related

Macro To Open File Saved In Same Location But File Name Changes With Each Date

Feb 8, 2013

I do routine tasks every day which involves opening 3 different files and pasting data into my main file. The data is always in the same format, and the 3 files are saved in the same location (3 different folders through). The 3 files are saved each day and the naming convention is constant, with only the date changing. For example, the files are always saved in C:My Documents and the files are called test_05.02.2013.xls. Tomorrow the file will be called test_06.02.2013.xls and so on.

So each day I will be rolling a file forward and I want to bring in the info from each of these files based on the new day.

How to do 1, and I will do the others (because the concept will be the same).

View 1 Replies View Related

Macro That Will Open The File Path

Dec 10, 2008

hi, i need a macro that will open the below file path, and when i select the file i would like the macro to copy the active sheet from the source file being opened from range A2:L10000 and then paste special values to destination CELL A16 of the activesheet of the workbook.

I would like the date format for the below to be generic so it will apply for all months and years.

S:RECSBANKRECNominees200812-2008

View 9 Replies View Related

Check File Open With Random Path

Oct 27, 2008

I have an application that requires users to download a file from a location that is then imported at their execution into the application. I've done my best to counsel users to download the file to their desktop (for ease of locating) and to stick with a standard filename so that there are no errors. Some of these people just don't take direction well, will save the file wherever, or save the name inappropratly, or worse, open up multiple copies of the same file corrupting the name: ie: FileName.xls, FileName.xls(1), FileName1.

View 5 Replies View Related

File Open Dialog Box, Get The Path To Textbox?

Mar 25, 2009

File open dialog box, Get the path to textbox? ...

View 7 Replies View Related

Open File Where Path, Name & Sheet Name Are Variables

Jan 18, 2008

I'm trying to use vba open a new workbook and then edit it. But i can not select cell in the new workbook. but it can be activated!

it can open the file (fname) and activate the sheets (sName), but will flage an error on range select.


Workbooks.Open fileName:=fPath & "" & fName
Workbooks(fName).Sheets(sName).Activate
Range("A8").Select

View 9 Replies View Related

Open File With Variable Path & Part Name

Feb 27, 2008

1 I need to open a csv file in order to use data in it at location "C:BarkingEMCIN" to input into an xls spreadsheet. I then need to use the info from the xls spreadsheet along with other info input by users to produce another .csv and it be deposited at "C:BarkingEMCOUT"

The name of the file at "C:BarkingEMCIN" will change everyday or even multiple times a day and be in the format "AVA_DA_260208_BPL_EDF_001.CSV" "AVA DA " will remain the same "260208" will be todays date the next 2 will be interchangeable depending on requirements and use BPL EDF and SSE will be interchangeable depending on requirements and 001 will be the version whcih will be changable. _ underscores will be used as seperators

They will then be save in the format "NOM_DA_260208_BPL_EDF_001.CSV" using the same prinipals as before but automatically saving as the next available when needed with a prompt to tell the user what it will be

View 5 Replies View Related

Open From Dialog Box To Insert File Path And Name Into Cell

Jun 21, 2009

Is there a way to use the open dialog box (like as if you where opening another workbook) and then with the selected item inster the path and file name into a cell.

View 2 Replies View Related

Open Windows File Chooser At Default Location

Feb 14, 2012

Is there any way of making the default directory location for application.getopenfilename work properly with shared locations?

Presently I use ChDrive then Chdir but I cant use ChDrive if workbook is opened from a link in email for example. Please see below

I have a VBA routine that asks the user to load an existing file on startup.

I want the window for the file selection to open at the same folder every time. (the folder is on a shared drive)

The workbook to run the code will always be located on this same share at a fixed location.

My present code builds the path to the desired opening folder by collecting the drive letter from the current working directory (which has to be done as everybody maps there shares to different letters here, its not guaranteed to be the same! )

then i ChDrive to this letter.

Then I ChDir to letter plus myKnowndirPath

This works fine, the window always opens at my required folder. But only as long as the user has navigated to the folder containing the spreadsheet and then ran it from there. Because that way a drive letter is available.

However i found that if i sent a link to the workbook or its home folder. And the user opens the link or a windows explorer from that link and then runs file from there.

Then it stops working beacause there is no local drive letter in the working directory path. i.e. working directory shows as

'network \shareddrive
ootafolderanother arget

instead of something like
J:afolderanother arget

View 2 Replies View Related

Launching Windows Explorer Path Error

May 27, 2007

I am trying to launch windows explorer from within excel vba. The routine below is borrowed from another post on this site and modified for my purposes.

Sub LaunchWindowsExplorer()

Dim PID As Double
Dim strRootPath As String

Const strExpExe = "explorer.exe"
Const strArg = " " '" /e,/root, "

'// Change rootpath here
strRootPath = "J:MyDirectoryWilliams,Bob 7264" ..............

View 9 Replies View Related

Excel 2010 :: How To Open Files From FTP Location

Nov 19, 2012

I am using xp pro, excel 2010 and the ftp server has linux installed. To open files from server I press open button in excel, then choose ftp location from drop down menu. FTP logon box asks password with the option of default user selected. I provide password and go on.

Some days ago something happened, I don't know what but as a result of it when I opened the FTP logon box, the anonymous option was selected by default. So I selected user option, gave id password and hit ok. It did not connect. Then I removed that ftp location from excel ftp locations. Whenever I tried to add an ftp location, excel restarted stating error message " *** encountered a problem *** ". So I reached a site after some googling and was directed to add the whole ftp file location path in the "File name" box of the open dialog box. It worked and the ftp location was automatically added in ftp locations. [ any ftp setting in excel is automatically transferred to ms word as well]

PROBLEM > Now I have a different problem. I can access ftp folders and subfolders but when I select a file and click open, downloading bar at the bottom of the excel does not start and after a long wait an error message pops up " the internet address ' ftp://192.168.****/folder/subfolder/filename.xls" is not valid. [I can open ftp files using filezilla etc]

View 2 Replies View Related

Open All Excel Files In Directory - Code Doesn't Work For One Specific Path

Feb 8, 2014

I have my code here:

VB:
Sub openfiles()Dim Path As String
Dim ExcelFile As String
' Path = GetFolder("C:UsersKinteshDesktop")
Path = "C:UsersKinteshDesktopVBA programmingMaps"
ExcelFile = Dir(Path & "*.xls")

[Code] ....

NextCode:
GetFolder = sitem
Set fldr = Nothing
End Function

My problem is that the code all actually works (including the function and when I use the commented part), but pointing to this one specific directory (the one I'm using right now), literally nothing happens.

View 6 Replies View Related

Excel Simple File Path Check?

Jul 5, 2014

how I could perform a simple file path check using excel.

For example:

File Path
Exists

C:ImagesMatrix.png
Yes

C:ImagesCubic.png
No

View 5 Replies View Related

Save Hyperlink Path For File With Absolute Path And Non-Relative?

Mar 4, 2013

is it possible to configure Excel in order to save the Hyperlink path for a file with absolute path and non relative?

I notice that the hyperlink is ....pdf ry.pdf

if I change the position of the file excel there is a problem!

I would like to save es. d:invoichepdf ry.pdf

View 1 Replies View Related

Trim Full File Name & Path To File Path Only

Sep 27, 2006

I have a variable ("DestFile") that defines a path to a file (used in saving the file)...

I'm in the process of getting a Sub to hyperlink to this file, but in some circumstances, I may only want to hyperlink to the folder, not the actual file...

How would I go about trimming the "DestFile" address to get a "DestFldr" address?...

An example of "DestFile" might be;
S:BryanFor KenGulf ConstructionST0609014-t.xls
(the file name length may vary)
What code can I use to consistently trim it back to;
S:BryanFor KenGulf Construction
as the "DestFldr" variable?

View 4 Replies View Related

Excel 2010 :: Default File Location Not Working?

Apr 19, 2013

I'm using Excel 2010. When I go into the Excel Options, to the Save option and try to type in a specific network drive in the Default File Location: box, I click OK and then it doesn't save the changes. I close Excel down all the way and then restart a new Excel session and it keeps going back to "LibrariesDocuments..."

It doesn't seem to be just related to Excel...having the same issue in Word and Access 2010 as well.

View 3 Replies View Related

Open Folder In Explorer

Jul 18, 2008

I was wondering if it is possible to use a macro open a folder in Windows Explorer. Previously someone on this forum taught me how to open an Excel file from a macro, but in this case there will be a new file every week. As the files will all be stored in the same folder, I thought it would be easier to open the folder in the normal Explorer view and select the file manually than to change the macro every week.

I am using Windows XP and Excel 2003. My programmes are run from the C drive, but my documents are stored on the E drive. What I am looking for really is a line that says: open in Explorer E:data
ewprocessed.

View 12 Replies View Related

Opening Excel Files In File Path Which Includes Folders?

Nov 7, 2007

I am trying to open excel files in a file path which includes folders which also have excel folders i wish to open there are quite a few.

At the moment i am working with this code but it fails to open excel files which are within the folders in the specified file path. Its fine for excel workbooks in the folder specified by file path.

This is the code

Sub RunCodeOnAllXLSFiles()
Dim lCount As Long
Dim wbResults As Workbook

[Code].....

View 9 Replies View Related

Pass Data From Userform To Excel Sheet Using File Path?

Jan 18, 2012

How to pass data from userform to excel sheet using file path?

View 4 Replies View Related

Macro To Separate File Name And Path From Complete Path

Oct 3, 2012

I want to run a macro to separate File Name and Path from the given complete path

For Example

Code:

In Column A : Given Complete Path " C:MainFolderRecordsSubFilesFile1Record.pdf

I need it separeted like

Code:

In Column B :File Name = Record.pdf
In Column C :File Path = C:MainFolderRecordsSubFilesFile1

Is there any way to do this through a macro

View 2 Replies View Related

Show Workbook Location & Path

Jan 10, 2008

Is there a way to display the location of an active workbook on my local drive and save it into a varible. I'm new to Excel and VBA but I'm trying to create a template to use for multiple vehicles. When the macro is run...

1) the workbook will have to identify what Workbook and worksheet it is in and save it as a varible so that it can access it later. Each workbook is specific to a vehicle.
*(The reason is because I will need to refer to the address of the original workbook when pasting the copied data from the "OilChart" Workbook.)

2) Copy the vehicle identification # and save as a varible. (Dim vehicleNumber As Variant)

3) Open another workbook on the local drive (OilChart.xls)

4) Run the macro in the new workbook (OilChart.xls) to update the data

5) Search Column B in (OilChart.xls) for matches of the vehicleNumber, and for all rows that match, select and copy all rows and paste it back into the orig workbook (Vehicle Specific Workbook).

This is the code I have so far.

Private Sub btnFind_Click()

Dim vehicleNumber As Variant
Dim sourceLocation As String
Dim sourceFileName As String
Dim fileName As String
Application. ScreenUpdating = False

I have'nt figured out how to do step 5 yet so if anybody has any ideas I'd be open to them. I tried looking at Aaron Bloods Kickbutt VBA Find Function but I got a little lost on how his code would relate to my code. It also looks like it doesn't copy or paste anything to another workbook.

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved