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
ADVERTISEMENT
Jul 7, 2007
how to launch windows explorer from a path that resides in a cell using the code below.
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"
PID = Shell(strExpExe & strArg & strRootPath, 1)
End Sub
The problem I have is that once I have done this a number of times (probably somewhere between 80-100 times then I notice windows explorer starts to play up as if running out of memory. A reboot soon fixes that, however, I was wondering if there is anything I can add to the code to keep it from hogging up memory...if that is even possible.
When I say 80 - 100 times, I don't mean opening up 80 - 100 instances of windows explorer. I mean launching windows explorer, moving some files then closing that instance of windows explorer. Then coming back into excel and repeating that process.
View 9 Replies
View Related
Aug 16, 2012
Each time I click on an Excel file the worksheet will open up within an existing Excel worksheet that I have open. This is frustrating when you are working with two monitors or screens (laptop screen and additional monitor) and want to view each worksheet separately in separate screens. What I end up doing, which is not efficient, is I'll open the second worksheet which will open up in an existing worksheet that I have open and then I'll close it, and then launch a separate Excel worksheet and pull open the recent file and I'll have two open worksheets (not within same Excel worksheet I already have open). This allows me to grab and pull one worksheet in a separate screen and leave the other as I need both open on two monitors.
Question: is there a way to default Excel when opening or double clicking an Excel file to automatically open in a separate instance of Excel and not in an existing open worksheet?
View 2 Replies
View Related
Nov 19, 2009
The following 3 macros do the following.
1st macro . . . When the button is clicked for this macro, Windows Explorer is opened and the folder MyMenuFiles is selected. Works Fine.
2nd macro . . . When this button is clicked, the windows explorer opens with My Documents selected. Works Fine.
3rd macro . . . THIS IS THE PROBLEM ONE. When this button is clicked, windows explorer opens, with the C: drive selected. I want My Computer selected.
View 3 Replies
View Related
Apr 5, 2007
I'm sure this is really easy, but I'm learning and not having luck in the search option for previous posts. Thanks for your patience in advance.
I want to open a windows explorer window by using a button in Excel.
View 9 Replies
View Related
Jul 10, 2007
Is there a way to copy the information in a Windows Explorer page into Excel?
For example, for any given folder or sub-folder in Explorer, I'd like to copy the NAMES of (i.e., not the file itself or the contents of the file) FILENAME, SIZE, TYPE, MODIFIED date, etc..
View 11 Replies
View Related
May 14, 2009
Perhaps, this question is much more related to Windows API but I thought of posting it here incase I get some more ideas.
I am looking forward to develop a program wherein I can prevent or avoid an Excel file being overwritten by a different file with the same name in the same location in windows explorer.
After a rapid search on the internet I have got something which I could use but that would just serve me the purpose of retreiving the overwritten file in windows explorer.
View 9 Replies
View Related
Jun 6, 2002
What's the code for opening a Windows Explorer window from within an Excel Macro?
View 7 Replies
View Related
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
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
View Related
Sep 4, 2006
How to search and get the path of a folder present in windows registry using VBA excel.
View 9 Replies
View Related
Dec 19, 2006
the spreadsheet needs to be copied to a directory called "C:downloads" as it contains a ODBC query to itself (In reality, this is a query to an External Oracle Database)
On loading, it should pop up a simple userform, with a combo and two command buttons, which when pressed takes you to a (hidden) tab that displays a pivottable.
All works well until I try to close /save when 60% of the time, Excel encounters problems and closes and will not load up the file the next time until either quit excel or disable macros. Messages include "file/path access error", "I/O Error" or get restarts excel.
On a casual run through, I expect you might report back that "All worked ok for me". Please can you give it a bit of a thrashing, comment out the userform show, save the file (frequently) becuase i assure you it will break ultimately!
This is a brand-new file and I've tried it on about 5 different PC running different versions of Excel and generally get the same result.
View 7 Replies
View Related
Jul 21, 2006
I'm having some trouble with some VBA code written for Excel (Office 2003). I have a video file (in .wmv format) and a list of time stamps in an excel file. When I click a timestamp, I want to pop open the WMV and play it at that given time.
I've made some headway thanks to a few others, but I'm getting this "Run-time '424': Object required" error that I can't seem to fix. I've attached the file, and it occurs at the line "frmPlayer.Show" and I have no idea why!
View 9 Replies
View Related
Nov 20, 2013
I have been given a macro recorded on a mac and it works fine with Mac Excel 2011. Unfortunately, I need to make it to work on a windows machine, but it comes up with an error message "macro unable to set width property of the window class. Run-time error 1004". When I press debug it takes me to the line .Width = 1456.
Below is the chunk of the code that becomes highlighted when pressing debug.
With ActiveWindow
.Width = 1456
.Height = 795
End With
View 3 Replies
View Related
Nov 19, 2009
We have built quite a large Excel based program that contains quite a lot of coding. the program seems to work fine the majority of the time but every so often we recieve an error message that causes excel to not save, or to crash and shut down.
The message that comes up is "File/Path Error"
Now I've just done some hunting around online and some links I have found speak of declairing the document location correctly in the coding. I was wondering could this be the issue at hand?
Anytime the document needs to save, there is a cell with the directory path and file path declared as a variable (Actually as Dim String) within the coding. Is this the best way to declare a file path?
Also, the problem seems intermittent. We Compile the VBA coding before saving, we also use a Clean Project add-in within Excel. These processes usually help but every so often the problem comes back.
View 9 Replies
View Related
Jan 5, 2010
I have an excel 2003 template containing a userform that is displayed using the workbook_open event.
The userform causes excel to crash with file/path error 75. i have tried many suggestions given on ozgrid and several other forums with no joy.
When the userform crashes, the debugger stops on DataFormNew.show.
I have added stop commands in the initialise procedure to see what is going on and it appears that my userform has disappeared!
to upload the excel template and any other information required to get this sorted.
its size is 765 KB which exceeds the size limit to attach to the post.
here is the workbook_open macro:
Private Sub Workbook_Open()
'On Error GoTo MyError
'Call UnProtectAll
'Dim frm As UserForm
'For Each frm In UserForms
' Unload frm
'Next
View 9 Replies
View Related
Dec 12, 2006
The attached spreadsheet is as simple as it gets - a single userform with a combo box that allows 1 of 4 choices. It gets loaded and displayed in the workbook_open() event - or at least it should - but 9/10 times i get the message "Path/File error" and debug crashes out on the userform.show line. The next time I try and open the file (despite not saving it) Excel crashes and closes! Even re-starting Excel does not allow the file to be opened!
If, however, I open the file with macros disabled, and go into the VBE and manually run the workbook_open() all works fine. I'm using Excel 2003 and I've tried it on other installations - sometimes it will work, other times not.
I've tried every combination of userform load, unload, hide & show with similar results.
View 9 Replies
View Related
Jun 13, 2007
I am getting the following run time error when trying to use MoveFolder from the scripting runtime library:
run-time error ‘76’
path not found
The source and destination paths are picked up out of cells and I think the spaces in the name or the length of the path names may be causing the problem.
The source folder looks something like this (contains 50 characters):
K:Example123 Folder1AB CD ESubfold,XX abcdefgh
The destination folder looks something like this (contains 60 characters):
K:Example123 Folder1XX New123AB CD ESubfold,XX abcdefgh
The code is pretty basic:
Sub MoveFolder(Sourcepath As String, Destinationpath As String)
Dim FSO As Scripting.FileSystemObject
Set FSO = New Scripting.FileSystemObject
'some code here removes the trailing backslashes on the
'end of the pathnames
FSO.MoveFolder Sourcepath, Destinationpath
End Sub
I have double checked the source path name exists. I have also tried doing it manually with the path names being entered in as text but i keep getting the error.
View 9 Replies
View Related
Aug 7, 2008
When loading my workbook, my userform loads perfect, but when I go to hit the "next" button. It crashes with the error:
"Path/File access error."
The next button code, quite simple: ....
View 9 Replies
View Related
Jul 9, 2009
I have worked on this really difficult long formula, but the problem is, I have been working from my Mac. And my office, which this formula was made for, is all PC. Now generally this isn't a problem, but apparently PC's have a limit on how long the formula can be. Is there anyway to overcome this? I really need this formula to work..
View 9 Replies
View Related
Aug 18, 2008
I want to reference a workbook that i mentioned quite a bit in my macro code. However, I want to be able to change this workbook by just changing one line of code rather than having to go into my rather long code to change it every time.
Here's what I have so far:
Dim MyFile As Workbook
Set MyFile = ActiveWorkbook
Dim MyTarget As Workbook
Set MyTarget = windows("week 28 O.xls")
Then later in the code I have it reference MyTarget and MyFile.
MyFile opens the current workbook that I am creating and I was hoping that I could put MyTarget.Activate into every instance where it occurs and it would reference week 28 o.xls. (originally when I recorded this it had "week 28 O.xls".activate) So what I figured is that rather than having to go in and change the 28 to a 29 in every instance in the code (about 25 of them) I would just set MyTarget = ___ that way if I want to change to week 29 in all those instances I just have to change the 28 to a 29 in the set MyTarget line and then all the references to my target would apply to the new week 29.
However I'm getting an error at the Set MyTarget = windows("week 28 O.xls") line.
View 9 Replies
View Related
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
Feb 11, 2014
I am using an XY scatter chart that displays the planned path and an actual path as I go. The planned path is set up in 100' increments and goes 12000' and actual path varies along the way.
My data that I use is the Northing (ft), Easting (ft) and Vertical Section (ft) for both the planned path and actual path.
I was wondering if there was an east way to get that information from the chart or if there is a formula that would allow me to calculate distance between the two points by using the data I use for my chart.
View 1 Replies
View Related
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
Dec 17, 2008
I have a macro that launches word or excel files if the file address (e.g. C:Documents and SettingsHenryDesktop est.xls) is typed into cell A1 by looking at the last 3 letters of the file name.
I cannot find a way to enable it to launch pdf files as well (e.g. C:Documents and SettingsHenryDesktop est.pdf)
View 12 Replies
View Related
Jun 9, 2009
I hide all Excel standard tabs and thus need a button on custom tab to record a macro. (I did this successfully with custom menu in Excel 2003.) In 2007 ribbon, I've reused the code for a button's OnAction, now going to callback that runs:
Application.CommandBars.ExecuteMso ("MacroRecord")
In Excel 2003, the stop button appeared automatically for me. But in Excel 2007, with hiding standard tabs, etc., I see no way to stop recording, other than running my button to return the Developer's tab, where the Record Macro button has changed to Stop Macro.
I'd like to either add a second button to my ribbon to stop recording the macro (but I can't find an idMso to use in a callback) or have my Record button change to Stop button, like Excel does. But I can't come up with correct code.
View 4 Replies
View Related
Apr 14, 2006
I have a worksheet that is a graphical display of a call floor with its cubicles. I am able to pop up a box with many details about the workstation in the cubicle (see Display pop-up box when cell selected) for more details, and would now like to go further with this application.
Our practice is to use VNC to review the end users' screens when they call us for assistance; given that I know the machine name and IP address, how can I start a VNC browsing session for the target machine?
View 5 Replies
View Related
Mar 14, 2007
My company uses database software called Business Objects. At the moment few people are using the program and its reports as they can't find the key ones or workout how to run them correctly. As everyone is comfortable with excel. I am creating a series of forms to guide my users to the key reports. I like this method because it is very user friendly and I can add lots of descriptions. Unfortunately my programming knowledge is limited to excel so I can't write a standalone program as you might suggest I do.
The problem:
I want to launch the non-excel files using VBA. For example, a user will click on a "Customer" button to see a second form containing a list of customer reports. The user will then click on the button containing the name of the report they want to launch. I want the file to open. I tried using hyperlinks in an excel spreadsheet which works fine for opening the non-excel files, but it isn’t nearly as user-friendly or interactive.
View 4 Replies
View Related
Mar 3, 2014
I have a non Microsoft program file that I can open in excel. I usually make changes to the file; save it to its native format, then open up the non Microsoft program and open that file that I just edited in excel.
If I had to simplify it, using notepad as an example.
I open the TXT in excel and make changes.
Then Save the TXT in a folder location.
Open Notepad.
Browse to the folder Location.
Open the edited file.
I did not know if there was a quick VBA that I could use to get this to work?
View 9 Replies
View Related
Mar 13, 2014
I have a sub procedure that launches a hyperlink, but i have some conditionality so that if a cell (J3) is blank it pops up a message letting the user know they need to populate cell (J3). My problem is that if cell J3 is blank it pops of the message, but it still launches the link.
Sub NEWShyperlink()
Dim s As String
If Range("J3").Value = "" Then
MsgBox "Make sure you have entered the ticker symbol into cell J3!", vbExclamation, "Can not get News/Press Releases"
[Code] .....
View 6 Replies
View Related