Identify The Filter Used In Msofile Dialog File Picker
Nov 27, 2007
I am using the following code to allow the user to select files to open. I have realised that you can create multiple filters with the msoFileDialogFilePicker command, which is very useful, since the program initalliy takes multiple text files, loads them into a workbook as seperate sheets and then saves the workbook as an excel file. Therefore I would like the user to be able to select the text files to load but also to be able to check if the corresponding excel file already exists and if so to be able to directly open this rather than have to create a new file from the text files. Therefore my question is: Is there a way to be able to tell which filter was in use when the file was selected?
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "Excel Files", "*.xls"
.Filters.Add "Text Files", "*.txt"
.Show
' olWin.Activate
A = 1 ...........
View 2 Replies
ADVERTISEMENT
Mar 6, 2014
I am trying to create a multiple file picker. The code is below.
I want to open the first file of lets say 5 selected files, do some autofilter task, copy data from that file, paste it in another workbook and close it. Open second file, do some autofilter task, copy data from that file, paste it in below the first file pasted data in another workbook and close it... and File 3... and so on.
It works for one file, the code for copying pasting is not yet added. I think I can manage that. But how I return to the file picker function after it opens the first file.
View 1 Replies
View Related
Jun 18, 2009
what command can i use to bring up the save as dialog box ( where to name your saved file) if my file is already named?
View 2 Replies
View Related
May 3, 2008
I am looking for code that when cmdfile is click, it will open up the 'open file' dialog box, and go to a specified directory on the pc, and list ALL files in that folder, but not open it. I want the user to select the file manually.
I found the following code on the forums, but don't know if it is relavent in my case
Const myDir As String = "C:NAVIGATIONPERSONAL
ussNLN"
View 9 Replies
View Related
Dec 14, 2006
I want to be able to have the Save As dialog box come up, but with a File Name already chosen, so that the user can save it as this File Name in any location he/she wishes. I can get the Save As dialog box coming up with my code, but I don't know how to automatically enter the File Name
View 4 Replies
View Related
Jun 30, 2007
I am running a macro on startup from a template that opens the File Save As dialog box to allow the user to select a folder and filename and save it before continuing.
I would like it to default to the Q: drive, it defaults to where the template was opened from.
I used
Application.Dialogs(xlDialogSaveAs).Show
to open the dialog, I tried using "Q:" as an argument but it doesn't seem to work.
if I try
Application.Dialogs(xlDialogOpen).Show "Q:"
View 9 Replies
View Related
Mar 25, 2009
File open dialog box, Get the path to textbox? ...
View 7 Replies
View Related
Jul 8, 2013
I'm looking to create a macro that launches a dialog box upon file launch. Based on the input, I want excel to only show the tab which corresponds to the dialog box entry.
For example, if it asks "What is your name?" on file launch and I respond "Alex"; i want the tab labeled "Alex" to only be shown for the user.
View 1 Replies
View Related
Feb 20, 2014
I have the below code to have the user select a pile path and save. what can I add to have the dialog box preselect the file type to macro enabled? the .xlsm extension is not doing it.
['save it under a new name
Dim fPth As Object
Set fPth = Application.FileDialog(msoFileDialogSaveAs)
With fPth
.InitialFileName = Worksheets("Project Setup").Range("f19").Text & "_ROM Estimate.xlsm"
.Title = "Save your File:"
.InitialView = msoFileDialogViewList
.Show
End With]
View 4 Replies
View Related
Jan 11, 2010
my code brings up an empty dialog box.
The file I am trying to view is saved as follows: C: Test.gif
What I have done.Added a image control to a dialog box, called image1
Added the following event handler to image1:
x = c: test.gif
Image1.picture = loadpicture (X)Pressed F5 to test the code and brings up a dialog box with a blank image box.
Not called the userform in the main module (didn't seem much point considering the test failed)
My questions
where I am going wrong with this, the correct code?
Also in inputting the address of the file I could not use the C: format as this brought up an error. What is the correct format?
View 9 Replies
View Related
Jun 29, 2006
complete the attached code (Excel VBA) to automatically process a File Download dialog from Internet Explorer. I want to click "Save" which will produce the "Save As" dialog. Then I need to enter a default filename like (C:Temp) and click "Save" again. When this is working, I will hide Internet Explorer to make the operation completely transparent to the user. The URL is a sample chosen specifically for this test case.
Public Sub Report_Test()
Dim objIE As SHDocVw.InternetExplorer
Dim strURL As String
Dim varItem As Variant
' Establish connection to the Internet Explorer application.
Set objIE = CreateObject("InternetExplorer.Application")
' Set Internet Explorer visible.
objIE.Visible = True
View 3 Replies
View Related
Jan 31, 2007
I want to close a tab delimited Txt file that is open in Excel, thru' a macro, without the save changes dialog box appearing.
View 2 Replies
View Related
Jun 16, 2007
I am trying to white a macro that takes a file path from a cell value and opens that file. When there is no file path in the cell, it prompts a dialog box. This part is pretty much working. However, I would like the file path selected from the dialog box to be added to the cell in the original workbook.
Sub Reports()
Dim path1 As String
path1 = Range("B20").Value
On Error Resume Next
'checks if there is already a file path'
Workbooks.Open filename:= _
path1, Updatelinks:=1
'if no file path then opens dialog box'
If Error.Number <> 0 Then
Application.Dialogs(xlDialogOpen).Show Arg1:="*.*"
End If
End Sub
View 3 Replies
View Related
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
Jan 20, 2007
To have other users open a workbook on the network without having to click button to open it as read only.
I have been trying to get rid of the "File In Use" message for the other users since they only need a read only copy. I am the only one who needs to know if it is in use because I will make changes to the workbook tools and have to save them.
I have set the Save As preferences so that it requires a password for modification and checked the read only checkbox. But that dialog box is popping up for the users. I am trying to eliminate any file in use dialog box for users other than myself.
Here is my workbook open procedure...
Private Sub Workbook_open()
Dim wBook As Workbook
Dim UsrName As String
UsrName = Environ("username")
On Error Resume Next
Set wBook = Workbooks("Excel_Tools.xls")
View 3 Replies
View Related
Dec 20, 2006
VBA code Identify which user has a particular file open. This file is on our shared drive and recently we've had people open the file and leave their desk. They haven't input an Excel username so frequently we cannot tell who has the file open to ask them to close it.
I'm trying to write a macro that will tell me if the file is open and if it's open, who has it open (using their computer login name).
View 9 Replies
View Related
Aug 31, 2009
I have a summary file (I'll call it File A) from which a macro is run. It opens other files, finds a "total line" then copies it into File A. Then it closes that file, opens another, and repeats the process. The macro works fine for most of the files it opens and closes, but on some of them, upon the close command, a dialog box pops up asking "Do you want to save the changes you made to "File B.xls"?
I'm not sure why this comes up as there were no changes made. Cells were only copied and pasted into another file. Is there a way to stop this annoying box from popping up? It slows down the macro by waiting for human input. here is my
View 4 Replies
View Related
Nov 6, 2009
I currently have the following code that copies a range opens notepad pastes the range opens save dialog and types the file name. The problem I have is with overwriting the existing file.
Range("A1:A202").Select
Selection.Copy
Shell "notepad.exe", vbNormalFocus
SendKeys "^V"
SendKeys "^s"
SendKeys "Total_IEDs_Hour_Of_Day_2009.xml"
SendKeys "{TAB}"
SendKeys "a"
SendKeys "{ENTER}"
Everything works fine to this point. Then it opens the do you want to overwrite dialog and I cant get it to hit yes.
View 9 Replies
View Related
Mar 8, 2012
Is there a simple way to loop through and filter the values in col1, then save it to a file named by the filtered value? Would be good if it could keep all the formatting as well.
View 1 Replies
View Related
Jul 5, 2007
I am importing a text file, Comma Seperated, small sample below....
View 9 Replies
View Related
Apr 1, 2014
At the time of opening the file some macros are running automatically in my file as per my requirement. If auto filter is on then it disturbs my program. Sometimes I forget to remove auto filter before closing the file and it cause a problem in my file after opening it again.
Requirement is: Is there any code to prevent the file closing if the auto filter is on and give me a warning message 'Please remove auto filter first'.
View 2 Replies
View Related
Aug 5, 2005
I have 7 different time pickers on a userform. They work great...they are passing the time to the correct cells. The problem is that if I close the userform and then open it again, the time value goes back to 12:00:00 AM, leaving the proper time in the cell. I'm trying to change the value of the time picker to the value in the cell when I initialize the userform using the following:
If Range("IncidentTime").Value < "12:00:00 AM" Then
dtpIncident_Time.Value = Range("IncidentTime").Value
End If
When I run it, I get a Run-Time Error '35788, An error occurred in a call to the Windows Date and Time Picker control.
View 9 Replies
View Related
Sep 4, 2009
I have a userform containing a date picker control. I am trying to get the date that is selected on to a woksheet called " Bank Holiday's" in cell O21.I have placed the following code in to a button used to close the form.
Private Sub CommandButton1_Click()
Sheets("Bank Holiday's").Select
Range("O21").Select
Range("O21") = UserForm17.DTPicker1.Value
Unload Me
End Sub
View 9 Replies
View Related
Oct 16, 2008
Is there an easy way to get a date picker on a cell, example i want a date picker in cell C4. I know there is a code you write to get this to work and create some kinda user form, but just wondering if there is an easier way.
View 3 Replies
View Related
Aug 24, 2009
On the attachment i have a userform which pops up when cell B2 is selected. It is a month view from the additional controls on the control toolbox. I've also added a couple of text boxes with spin buttons.
A few amendments i want to make to it are:
User form pops up next cell B2
'Enter button' enters date and time into cell B2
Spin buttons increase/decrease hour field in incremnts of 1 and minutes field in increments of 5
View 14 Replies
View Related
Aug 13, 2003
when a date must be selected, you can do it through a button that opens up a little calendar page on which you just click on the date selected.
Is there anything similar in Excel Office XP, or is this asking too much??
View 9 Replies
View Related
Jan 7, 2004
I'm trying to use the Date/Time ActiveX control in Excel 2000 and it is giving me problems. I am attempting to use this control contained directly on a worksheet (not contained on a separate form). My problem is that each time I start the workbook, the date/time control resizes itself to have an extremely large height. I set the control's height at 18 but upon loading it shows the height as about 5x that value. However, the properties of the control still show it listed with a height of 18? No matter what I do, I cannot seem to find a way to have the control maintain its initial height. I've tried this in several different workbooks, and it does the same everytime.
View 9 Replies
View Related
Dec 26, 2012
How should i reformat the date and time picker? at this moments, it shows the date in the format of mm/dd/yyyy but the format that i want is dd/mm/yyyy.
View 10 Replies
View Related
Jun 6, 2014
I have userform In that Twotextbox Need to be Pickdate from Popupcalender..while placing cursor on Textbox1 and textbox2 it popup shows Pickupcalender.... I tried with different code still failed
Go to sheet Repor Wizard Form ,Click Report filter & Export cmd button
find the attachment
View 4 Replies
View Related
Oct 15, 2010
I need to put date picker in excel 2010, the earlier doen't work.
View 5 Replies
View Related