Question about Microsoft Office Professional 2007 Full Version for PC

2 Answers

Application.FileSearch I have a VBA code on MS Access 2003 version but when i open it in MS Access 2007 it highlight on "Application.FileSearch" and display a message does not recognize... can somebody help..!

Posted by on

  • eeder1 Jan 29, 2009

    I am switching from Office 2003 to 2007 and the application.search function in the following code is giving me a runtime error which I am finding out is common..any suggestions to fix would be greatly appreciated



    E





    Private Sub CommandButton1_Click()


    Dim i As Integer
    Dim RdWrkBk As String
    Dim WrWrkBk As String
    Dim CodeWrkBk As String
    Dim a As Integer
    Dim sort As Integer


    a = 6


    CodeWrkBk = ActiveWorkbook.Name

    Application.DisplayAlerts = False
    Application.ScreenUpdating = True

    RdWrkBk1 = ActiveWorkbook.Name
    counter = 0

    Do
    test = Workbooks(CodeWrkBk).Worksheets("1").Cells(7 + counter, 8)
    counter = counter + 1
    Loop Until test = ""

    Call GetBrowse
    With Application.FileSearch
    .NewSearch
    .LookIn = strPath
    .Filename = "*.xls"
    If .Execute() > 0 Then
    Workbooks.Add
    WrWrkBk = ActiveWorkbook.Name
    x = Workbooks(WrWrkBk).Worksheets.Count

    sort = 8
    For i = 1 To counter - 1
    Application.ScreenUpdating = False
    strfile = .FoundFiles(i)


    Find_Last_Slash (strfile)
    strfile = Mid(strfile, 1, position)
    a = a + 1
    strDiv = Workbooks(RdWrkBk1).Sheets(1).Cells(a, sort).Value
    strfile = strfile & strDiv & ".xls"

    Workbooks.Open strfile 'open workbook

    Find_Last_Slash (strfile)
    RdWrkBk = Trim(Mid(strfile, position + 1, 50))



    newname = "Unit Waterfalls-" & Workbooks(RdWrkBk1).Sheets(1).Cells(i + 6, 9).Value

×

2 Answers

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 1 Answer

'!!! Replacement solution including searching in subdirectories !!!!


//------------------------------------------------------------------------------------------------
Sub FileSearchByHavrda_Example_of_procedure_calling()
'
' Example of FileSearchByHavrda procedure calling as replacement of missing FileSearch function in the newest MS Office VBA
' 01.06.2009, Author: P. Havrda, Czech Republic
'
Dim FileNameWithPath As Variant
Dim ListOfFilenamesWithParh As New Collection ' create a collection of filenames
' Filling a collection of filenames (search Excel files including subdirectories)
Call FileSearchByHavrda(ListOfFilenamesWithParh, "C:\Temp", "*.xls", True)
' Print list to immediate debug window and as a message window
For Each FileNameWithPath In ListOfFilenamesWithParh ' cycle for list(collection) processing
Debug.Print FileNameWithPath & Chr(13)
MsgBox FileNameWithPath & Chr(13)
Next FileNameWithPath
' Print to immediate debug window and message if no file was found
If ListOfFilenamesWithParh.Count = 0 Then
Debug.Print "No file was found !"
MsgBox "No file was found !"
End If
End Sub
//------------------------------------------------------------------------------------------------
Private Sub FileSearchByHavrda(pFoundFiles As Collection, pPath As String, pMask As String, pIncludeSubdirectories As Boolean)
'
' Search files in Path and create FoundFiles list(collection) of file names(path included) accordant with Mask (search in subdirectories if enabled)
' 01.06.2009, Author: P. Havrda, Czech Republic
'
Dim DirFile As String
Dim CollectionItem As Variant
Dim SubDirCollection As New Collection
' Add backslash at the end of path if not present
pPath = Trim(pPath)
If Right(pPath, 1) <> "\" Then pPath = pPath & "\"
' Searching files accordant with mask
DirFile = Dir(pPath & pMask)
Do While DirFile <> ""
pFoundFiles.Add pPath & DirFile 'add file name to list(collection)
DirFile = Dir ' next file
Loop
' Procedure exiting if searching in subdirectories isn't enabled
If Not pIncludeSubdirectories Then Exit Sub
' Searching for subdirectories in path
DirFile = Dir(pPath & "*", vbDirectory)
Do While DirFile <> ""
' Add subdirectory to local list(collection) of subdirectories in path
If DirFile <> "." And DirFile <> ".." Then If ((GetAttr(pPath & DirFile) And vbDirectory) = 16) Then SubDirCollection.Add pPath & DirFile
DirFile = Dir 'next file
Loop
' Subdirectories list(collection) processing
For Each CollectionItem In SubDirCollection
Call FileSearchByHavrda(pFoundFiles, CStr(CollectionItem), pMask, pIncludeSubdirectories) ' Recursive procedure call
Next
End Sub
//------------------------------------------------------------------------------------------------

Posted on Jun 24, 2009

  • Level 1:

    An expert who has achieved level 1.

    Hot-Shot:

    An expert who has answered 20 questions.

    Corporal:

    An expert that hasĀ over 10 points.

    Mayor:

    An expert whose answer gotĀ voted for 2 times.

  • Contributor
  • 36 Answers

Probably there is a incompatability between 2003 and 2007 for this. You could try to create the database blank in 2007 and then import the objects from your 2003 database.

Posted on Jul 26, 2008

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

2 Answers

PowerPoint Viewer error 32-bit


Try PowerPoint Repair Toolbox is powerful .PPT repair software, resolving any problem, causing the damage of PowerPoint files.

For more: https://www.pptrepairtoolbox.com/

Apr 09, 2015 | Microsoft Office Professional 2007 Full...

1 Answer

What is the extension file name for a microsoft access file?


According to Wikipedia:-

Access Project .adp
Access Blank Project Template .adn
Access Database (2007) .accdb
Access Database Runtime (2007) .accdr
Access Database Template (2007) .accdt
Access Database (2003 and earlier) .mdb
Access Database, used for addins (2,95,97), previously used for workgroups (2). .mda
Access Database Template (2003 and earlier) .mdt
Access Workgroup, database for user-level security. .mdw
Access (SQL Server) detached database (2000) .mdf
Protected Access Database, with compiled VBA (2003 and earlier) .mde
Protected Access Database, with compiled VBA (2007) .accde
Windows Shortcut: Access Macro .mam
Windows Shortcut: Access Query .maq
Windows Shortcut: Access Report .mar
Windows Shortcut: Access Table .mat
Windows Shortcut: Access Form .maf

Jun 03, 2010 | Microsoft Office Access 2003 (077-02871)...

1 Answer

When using any microsoft office 2007 application get an error saying that microsoft office has stopped working. Can open a new file most of the time but when opening old files get this message. Files can...


Well this is nothing but a compatability problem. Some files which are written in MS office 2003 or other previous versions can't be opened in MS Ofiice 2007.

May 27, 2010 | Microsoft Office Professional 2007 Full...

1 Answer

How to dov VBA in ms office 2007


Right Click on the sheet name on the bottom left corner of the excel window and on the pop up menu, click on "View Code". It will open a box where you can perform VBA Coding.

Aug 04, 2009 | Microsoft MS OFFICE 2007 SBE MLK (NA) SW....

2 Answers

How to open ms office file in different version


you need to open the file on the same version then save it again but on the version that you need, cause an older version could not open a newer, on the newest you have the option to save files at any version that you need

Jul 28, 2009 | Microsoft Business & Productivity Software

1 Answer

Bay7070@yahoo.com


There could be a number of reasons for this error, most likely something wrong with your VBA code. Check out this troubleshooting thread.

Let me know how it goes for you!

~~Cheryl

Jan 09, 2009 | Microsoft Office Professional 2007 Full...

1 Answer

File not available


it might be the virus effect, or the files of office 2007 could not open on previous versions of MS office. the files must be saved as ms office 97-2003 files.

Dec 23, 2008 | Microsoft Office Professional 2007 Full...

1 Answer

Microsoft excel 2007


first of all format C-drive.Then you should install windows-XP (SP-2) or Windows Vista and finally install MS-office 2007 application software.

May 14, 2008 | Microsoft Office Professional 2007 Full...

1 Answer

Office 2007 Standard - VBA not working


There is no indication that VBA should not work in all versions of Excel. There is a new file extension (xlsm), which is used to activate macros and allow usage. If you have, perhaps, opened and saved with incorrect extension (new is xlsx), VBA may be unavailable. Try to resave it with the changed extension. It seems likely that this is the issue (reference http://office.microsoft.com/en-us/excel/HP100141031033.aspx?pid=CH100648071033). Also, if you make sure your Save As option is set at xlsm, this should help to prevent problems. VBA should not be an issue in any version of Excel and custom functions ARE available (see http://office.microsoft.com/en-us/excel/HA102189961033.aspx?pid=CH100645021033). It should be as simple as changing the extension, and I would suggest changing the default save as option. If this helps, please rate "FixYa"! Thanks!

Apr 03, 2008 | Microsoft Office Standard for PC

Not finding what you are looking for?
Microsoft Office Professional 2007 Full Version for PC Logo

1,255 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Business & Productivity Software Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18304 Answers

Tony

Level 3 Expert

2598 Answers

Are you a Microsoft Business and Productivity Software Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...