Excel For Mac, Application.FileSearch Not Working

Nov 3, 2009

This relates to Excel for Mac 2004

I'm trying to use Application.FileSearch in a procedure to open files in a folder one by one and then do some stuff. It works fine when I developed it on my Windows machine but won't work on the Mac platform. The culprit instruction seems to be the

Application.FileSearch instruction, and I've also tried what I think may be a Mac equivalent Application.FileFind, but I get the 'Object doesn't support this action' error.

So I wrote a simple procedure below just to test the .FileSearch instruction but this fails in the same way.

Any ideas anyone? I've commented out lines which relate to Windows syntax.

View 12 Replies


ADVERTISEMENT

Application.filesearch Not Working In Excel 2007

Dec 20, 2009

I wrote a macro to list all the excel files from a directory and its sub-directories to an excel sheet. It is working in excel 2003 but shows error (object does not support this action) in 2007. Actually I have copied almost this entire macro from excel 2007 help only. Can somebody modify this to use in both the versions of excel?

View 6 Replies View Related

Application.FileSearch Is Not In Excel 2007

Jun 26, 2007

The Application.FileSearch method is not available in excel 2007, is there a similar functionality I can use?

View 9 Replies View Related

Application.FileSearch Excel 2007 Update

Jul 3, 2009

I have a piece of code that was written by someone else (namely Phil_V, from these very forums) that only works in versions of Excel before 2007. I was just hoping that someone could update the code for me?

I know it's a lot to ask, but I simply don't have the expertise to do it myself I really appreciate any help received.

The code that needs updating is as follows:

View 10 Replies View Related

Application.FileSearch Is Gone In Excel 2007 -- Alternatives

Jun 24, 2007

For those who use Application.FileSearch in Excel and Access, it's a huge pain that the object has been hidden in Office 2007.

I spent some time looking around for alternatives and have found two so far.

1. A FileSearch class that you can add to your project. Instead of using Application.FileSearch, you reference FileSearch instead

2. You can also use VBScript.

View 9 Replies View Related

Application.filesearch

Jun 27, 2007

I have created a macro that must extract data from other workbook. It opens the workbook, with an exist, and isopened control, and then open it. Itīs running well, but i found while making another macro, that if the file direction is "http://www.xxx.com:8080/Challange%20Cost%20Proposal%20Sheet.xls", then i cant run the exist control. Next you have the code im using. In the first version, i had .LookIn = ThisWorkbook.Path. Now Iīve tried:

1. Dont put .LookIn, and fName is "http://www.xxx.com:8080/Challange%20Cost%20Proposal%20Sheet.xls"
2. .LookIn = "http://www.xxx.com:8080/"
.FileName = "Challange%20Cost%20Proposal%20Sheet.xls"

Both are failing, it says, the file doesnt exist. If i try directly WorkBooks.Open "http://www.xxx.com:8080/Challange%20Cost%20Proposal%20Sheet.xls", it opens correctly, but i would have a control, because the original file name could change, and the macro would crash if does.

Function OpenWorkBook(fName) As Integer
If Exists(fName) Then
If (IsOpen(fName) = False) Then
Workbooks.Open (fName)
OpenWorkBook = True
Else
MsgBox "The WorkBook " & originWorkBookName & " is already open."
OpenWorkBook = -1
End If
Else.........................

View 5 Replies View Related

Application.Filesearch 2007

Feb 5, 2010

Filesearch......

Just been upgraded to 2007 and computer says no......

Iv only been VBA'ing for around 6 months and really am still very new to it.....

The bit that goes wrong is:

View 11 Replies View Related

Application.FileSearch Error '445'

Mar 3, 2007

The following code works fine in Excel 2003 but returns the following error in Excel 2007:

Run time error '445'
Object does not support this action

Sub List_Files()

Dim lCount As Long
Dim wbResults As Workbook
Dim wbCodeBook As Workbook

Set wbCodeBook = ThisWorkbook

With Application.FileSearch
.NewSearch
.LookIn = "C:DepartmentsInventory"............

View 9 Replies View Related

Code That Used Application.FileSearch

Apr 18, 2009

It seems to me that Application.FileSearch is not working with XP SP3.

I have a code that used Application.FileSearch and it works perfectly at home. But when I use in the office, it does not work. When I click on HELP menu, the one in the office has a Microsoft Excel 2003 SP3 whereas the one at my home does not have the SP3.

View 9 Replies View Related

Application.filesearch Replacement For 2007

Jun 26, 2008

I am trying to search a folder that is selected by the user for all .jpg files, and then place all those pictures onto a certain spreadsheet within the excel file. It also formats the pictures. Following is the
Private Sub BatchProcessThumb2x3()
Msg = "Select a file containing the photos you want to insert."
Directory = GetDirectory(Msg)
If Directory = "" Then Exit Sub
If Right(Directory, 1) "" Then Directory = Directory & ""

On Error Resume Next
With Application.FileSearch
.NewSearch
.LookIn = Directory
.Filename = "*.jpg"
.SearchSubFolders = False
.Execute

' Select begining range
Worksheets("Thumbnail (2x3)").Select
Range("B4").Select
' Loop through all files and process them

For i = 1 To .FoundFiles.Count..............

View 9 Replies View Related

Application- FileSearch Method In 2007

Sep 24, 2007

I have a macro running in Excel 2003 that uses application.filesearch. I discovered through another post that this is not included in Excel 2007. A replacement was suggested and I cannot get it to work. Can someone show me how to replace application.filesearch in my macro with the replacement code? I'm a real novice and can't figure out what I'm doing wrong. Or if you have a better solution I'm open for that as well.

Here's the original that works in 2003, the suggested replacement code will follow.

Sub GoGetData()
Dim lCount As Long
Dim wbResults As Workbook
Dim wbCodeBook As Workbook

Application. ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False

On Error Resume Next

Set wbCodeBook = ThisWorkbook

With Application.FileSearch
.NewSearch
'Change path to suit
.LookIn = "C:Temp1"

View 3 Replies View Related

Logic Behind The Application.FileSearch Sort Method

Jul 6, 2009

I am writing a class to be used in Excel 2007 that will mimic the action of the FileSearch in 2003, but I am stuck with the sort.

View 2 Replies View Related

Application.FileSearch To Obtain Last Modified Date

Mar 4, 2010

I've been trying to get this to function correctly. The following code does pull out a list of all filepaths, but what I want to to is access the properties of the file.

Basically I select a customer from a combo box, and from this the code does a vlookup to determine what folder the reports are stored in. The list is then entered onto the worksheet 'FilesInReportFolder'. There is some commented out code as I've ben trying to come up with a simple way to remove the 'xls' from the end of the string, but din't worry about that.

I've found a website that suggests adding .name to the lineto get the name instead of the path, but what I really want is be able to pull out other details about the file.

Here's my

Private Sub ComboBox1_Change()

Combobox1value = ComboBox1.Value

Dim rng As Range
Dim RowNo As Integer
Dim NoOfFiles As Integer
Dim foundfilepath As Integer
Dim FilePath As String

View 9 Replies View Related

Application.filesearch Replacement For Office 2007

Jun 20, 2007

In the following thread, richphillips wonders about Application.Filesearch
Application.filesearch In Office 2007

Is there a replacement for this? I have several macros that use Application.Filesearch and I would like it to work not only with Excel 2003 but also with Excel 2007. This is the function

Function CreateFileList(FileFilter As String, _
IncludeSubFolder As Boolean) As Variant
' returns the full filename for files matching
' the filter criteria in the current folder
Dim FileList() As String, FileCount As Long
CreateFileList = ""
Erase FileList
If FileFilter = "" Then FileFilter = "*.*" ' all files
Debug.Print CurDir
strFolder = BrowseForFolderShell(, , , 0)
If strFolder = "" Then
MsgBox "You Cancelled"
Exit Function
End If............

View 9 Replies View Related

Code For File Directory Loop - Use Of Application.Filesearch

Feb 11, 2009


I have been trying to process Excel files in a directory with the following

Sub FindExcelFiles()
Dim foldername As String
Dim FSO As Object
Dim fldr As Object
Dim file As Object
Dim cnt As Long
foldername = "c:usersseagreendesktopTuesdayFeb102009week ending feb 7 2009 esting2"
Set FSO = CreateObject("Scripting.FilesystemObject")
Set fldr = FSO.GetFolder(foldername)
For Each file In fldr.Files
If file.Type Like "*Microsoft Office Excel*" Then
cnt = cnt + 1
End If
Application.StatusBar = "Now working on " & ActiveWorkbook.FullName
DoSomething ActiveWorkbook
Next file
Set file = Nothing
Set fldr = Nothing
Set FSO = Nothing
Range("A1").Value = cnt
End Sub
Here's the stub for the subroutine that's being called:


Sub DoSomething(inBook As Workbook) 'Massage each workbook
'Debug.Print "Hello"
Debug.Print ActiveWorkbook.FullName
End Sub
I am using Excel 2007. I found out I cannot use Application.Filesearch as Microsoft has dropped this method for 2007. My problem now is that I just see "Now working on c:usersseagreendesktopTuesdayFeb102009week ending feb 7 2009 esting2file1.xls written six times in the immediate window.

View 9 Replies View Related

Speed Up Search Application.filesearch Is Slow To Respond

Apr 4, 2007

I am trying to determine in code whether a file exists in a certain location. This seems to be very slow even in a folder which contains just one file. Is there any way to speed up this process? Three seconds seems like a long time especially given that I will have to loop through this Sub many times. The files I am looking for are CSV so I can't use msoFileTypeExcelWorkbooks unless I can modify what file extensions this looks for. I only started dabbling with VBA a few weeks ago so it is entirely possible I'm barking up the wrong tree and should be using another method to acheive my aims.

Sub CISORTEST()
With Application.FileSearch
.NewSearch
.LookIn = "C:TEMP"
.SearchSubFolders = False
.Filename = "MYCSVFILENAME"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles

If .Execute > 0 Then
Call DoStuff()
End If

End With
End Sub...........................

View 6 Replies View Related

Application.FileSearch Not Returning Results On Some Pre 2007 Computers

Feb 11, 2008

Found code to find files and return results.. edited to my liking(barely.. i have no VBA knowledge).. it works on the PC I use. This is intended to be on a shared folder across a network for others to use, and it is not returning any results on the other PCs. This computer has Office 2003.. the rest have 2000. I can NOT figure out the problem. I have read in searches that Application.Filesearch is not reliable, but I do not know how to change it to any other type of coding
Attachment 26214

Option Explicit

Sub SrchForMSDS()
Dim i As Long, z As Long, Rw As Long
Dim ws As Worksheet
Dim y As Variant
Dim Fil As String, FPath As String
y = Application.InputBox("Search for file(s) named:", "MSDS Search")
If y = False And Not TypeName(y) = "String" Then Exit Sub
Application. ScreenUpdating = False
With Application.FileSearch
.NewSearch
.LookIn = "\My-SbscompanyMSDS Database"
' \#.#.#.#companyMSDS Databse or My-Sbs
.SearchSubFolders = True
.Filename = y................

View 4 Replies View Related

Excel 2010 :: Application Visible And Display Alerts Not Working

Nov 23, 2011

I am trying to hide the excel 2010 application, open a csv file on a network drive, show the excel application.

The problem is a "Downloading" progress indicator appears, during the workbook open event I assume.

Code:
Sub Macro1 ()
Application.Visible = False
Application.DisplayAlerts = False
Workbooks.Open Filename:="S:LOGT5.CSV"
Application.Visible = True
Application.DisplayAlerts = True

I have seen the similar progress indicator during the "Save" event too. How to hide this?

View 3 Replies View Related

Application.DisplayAlerts Not Working

Jan 14, 2010

I am trying to suppress the message box displayed while executing the macro.

View 2 Replies View Related

Application.SendKeys Stopped Working

Aug 17, 2007

I have a simple macro that from Outlook Express sends emails, with the last code line to mimic ALT+S on the keyboard to send the message

Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"

Yesterday I needed to install some new software that required at the end reinstalling of Microsoft Redistributable 2005. Not sure if for that reason but now the last line (the SendKeys) is not sending the email automatically anymore. What happens is:
-the email message windows pops up but is not being sent unless i do it manually (if i get rid of the two seconds pause ahead of that)
-have a VB error message that takes me before the SendKeys line (if I keep the two secs wait ahead of that)

It looks to me that either:
-the pc is not active anymore on the email message therefore the SendKeys doesnt work
-somehow the instruction finds the "door" shut by something else
-worse of all, the software has messed up with those send keys commands (tried to reinstall it but to no avail)

View 13 Replies View Related

Change To An Existing And Working Application

Nov 4, 2007

I am trying to make a change to an existing and working application. Right now, I read in a list of clients from my spreadsheet to my Userform. When the user (that's me as well) clicks on a name, (or names) the software takes over and does stuff with their biweekly payments. What I want to do is this: Not only show the names, but also the biweekly payments next to the names. The reason for this is some clients send in more than the assumed biweekly payment. As a first start, I changed my Initial function to read in two columns from my spreadsheet and not just one. The range name listbox_rwosource is d100:e112.

This is the only change I made. However, when I run the program - I still only see the names?

Public Sub InitMyUF()
Dim I As Integer
'UserForm1.ListBox1.RowSource = "current_clients"

View 9 Replies View Related

Application.ScreenUpdating = False Not Working

Jan 22, 2009

For some reason Application.ScreenUpdating = False has stopped working for me.

For testing purposes, I have freshly opened Excel (2003 SP3) and into the brand new workbook, added the following macro:

*****************
Sub Test()
Application.ScreenUpdating = False
For i = 1 To 40
ActiveCell = i
ActiveCell.Offset(1, 0).Select
Next i
End Sub
*****************

When I run this macro, I see the individual values being written on the screen.
Stepping through the code and using Watch, I can see that Screenupdating is set to False by the first line, but as soon as the Activecell is changed, Screenupdating is reset to True.

If I turn events off by adding Application.EnableEvents = false to the start of the macro, all works as expected, however I do not want to use this "workaround" as I use event driven macros.

View 9 Replies View Related

Application.ScreenUpdating = False Not Working??

Jul 18, 2006

I've got a listbox which populates a second listbox from cells on a hidden worksheet which is done through macros. Every time I select a value in the listbox, the screen " flickers" to the hidden worksheet. I want to be able to do the whole process without that "flickering". I tried using Application.ScreenUpdating = False, but it still flickers. Have I overlooked something?

Sub GetStaffteamQuery()
Application.Calculation = xlCalculationManual
Dim sConnParams, sSQL As String
Dim dbFile, dbPath, dbName As String
ThisWorkbook.Activate
Sheet3.Select
dbFile = "CounsellorData.mdb"
dbName = "CounsellorData"
dbPath = Sheet3.Range("databaselocation").Value
selectedgroup = Sheet3.ListBox1.Value
If VBA.Right(dbPath, 1) <> "" Then
' if last char in dbPath has no slash.................

View 4 Replies View Related

Macros That Were Working In Excel 2003 Are Not Working In 2007

Jan 25, 2010

I have a workbook in excel 2003 which I had been running the following macros (listed below). We recently upgraded to Excel 07, and neither are working. When I try to run them, the "debug" option highlights the following line in the sort macro "Range("A2:z" & lastcell).Sort key1:=.Columns(1)". This is driving me crazy, as the macros worked perfectly under the older version of Microsoft. Is there an issue with crossfunctionality between '03 and '07'.

Private Sub Worksheet_change(ByVal target As Excel.Range)
If target.Column = 1 Then
ThisRow = target.Row
startRow = 1
i = 1
Set ws = ActiveSheet
maxRow = Cells.SpecialCells(xlLastCell).Row
maxCol = Cells.SpecialCells(xlLastCell).Column
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
Do While i

View 9 Replies View Related

Closing Another Application From Excel VBA

Sep 19, 2013

I have code that opens a .pdf file and copies the content to an excel spreadsheet.

However, in order to loop through multiple pdf's, I need to be able to close the Adobe Reader application before I open each new pdf file.

With excel being the active application, any suitable code to activate and close Adobe Reader?

View 1 Replies View Related

How To Auto Close Excel Application

Jun 15, 2014

Any way to auto-close the excel application after finishing my macro run?

I tried this code,but it doesn't work... i added a sub and ran it like this:

Sub CloseandSave()
ActiveWorkbook.Close SaveChanges:=True
End Sub

to be more specific,there is a macro running,closes all open workbooks,but excel itself stays open...

View 4 Replies View Related

VBA To Exit Excel Application Not Only Workbook?

Feb 17, 2012

I have some code that I am using to save and close the active workbook, this code works perfectly, but I need the code to also close the excel application, not just the workbook. I have tried active window.close but it didn't work even though when I recorded the actions that was the code that I was give.

background -I set a task in my OS to open the workbook, then I wrote some code on the Workbook.open trigger to run and then save and close, but only the activebook closes.

View 2 Replies View Related

Application.Quit Not Closing Excel

Sep 13, 2006

I hate to have to come back to the forum after I Thanked you all for solving my problem, but here I am.

The code below disables the (X) button, no problems

Option Explicit
Public BooleanForClosing As Boolean
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If BooleanForClosing = False Then
Cancel = True
MsgBox "Please Use Exit Button"
End If
End Sub

The next code saves the workbook , but won't Quit the programme and goes back to the Exit Button ...

View 3 Replies View Related

Excel 2013 :: Worksheet Freeze With Application?

May 28, 2014

I encountered a strange anomaly where a worksheet "freezes" when Application.DisplayFormulaBar = False. I can only replicate this in Excel 2013. Excel 2010, for example, works perfectly well, and as expected.

[Code].....

To replicate the anomaly (Excel 2013 only):

1. In a new workbook, insert an ActiveX command button on "Sheet1", no code required.

2. Run the following code

[Code] .....

3. Click on the command button.

4. Now click on any cell and try to enter a value.

Is your screen "frozen"? If so, go to another sheet, return to Sheet1 and try again. Does it work?

Here's an alternative code for MyTest() that causes no problems. Can spot the difference? Is there a reasonable explanation?

[Code] ....

Even more curious, call the following MyTest3 on Workbook_Open() and the workbook behaves. Run MyTest3 again and the screen starts freezing(!)

[Code] .....

View 3 Replies View Related

Excel 2007 :: Change Orientation Of Entire Application

Apr 11, 2012

Someone Im working with says she used to change Excel to work on it on some vertical monitor. Is there a way to do that in Excel 2010 or even 2007?

Obviously I'm not talking about print layout, but viewing the whole application in portrait view, as if she turned a monitor sideways and altered the Aps view.

View 6 Replies View Related







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