Home > Forum Home > Developing and Auditing Analytical Models > Migrating Excel VBA projects to OpenOffice Basic > Unable to make Excel Macro to work in OpenOffice Share

Unable to make Excel Macro to work in OpenOffice

Excel Help for Unable To Make Excel Macro To Work In Openoffice in Developing and Auditing Analytical Models


Forum TopicLogin

Unable To Make Excel Macro To Work In Openoffice

Rate this:
(2.6/5 from 5 votes)
SadHey

I am unable make the Macro created in Excel to work with OpenOffice. I have tried the link http://www.business-spreadsheets.com/vba2oo.asp to convert the code but even that failed. Could you please help me with this.

I just wanted to list all the files in a Folder (including Subfolders) in to the calc sheet. Please see the original VB code i was using in Excel. (attached) and please send me the code which will work in OO.

VBA Code:
Sub JAD()
     Dim fs As FileSearch, i As Long
     'ws As Worksheet,
      Set fs = Application.FileSearch
      With fs
          .SearchSubFolders = True ' set to true if you want sub-folders included
          .Filename = "*.jad"
          .LookIn = "E:\Task\Volleyball" 'modify this to where you want to search
          If .Execute > 0 Then
              ' Set ws = Worksheets.Add
              For i = 1 To .FoundFiles.Count
                 Cells(i + 1, 26) = Mid$(.FoundFiles(i), InStrRev(.FoundFiles(i), "\") + 1)
              Next
          Else
               MsgBox "No files found"
          End If
      End With
  End Sub

 Joe
 Posted by on
 
View Full Post

Find relevant Excel templates and add-ins for Unable to make Excel Macro to work in OpenOffice in the