Macro to inport WK4 file extension into excel

Isabella

Well-known Member
Joined
Nov 7, 2008
Messages
643
Hi, i need help in creating a macro that will inport file exention which has WK4 , i have lotus notes at work i have exported email file to drive U:\ , i require a macro to pick this file up and export to Sheet Group_Mailbox. The range is A9
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
The full solution viewed okay on my computer, but here is the cached version.

http://209.85.229.132/search?q=cach...xcel/Q_23121017.html+LOTUS+123+WK4&cd=3&hl=en

If that doesn't work, search Google for LOTUS 123 WK4 and the first 3 results are all the URLs I have posted.

Ok this is a start, but i need the code to read only one selected file rather than multiple, and also we need to add delimited to the code.


Code:
Sub ConvWk4ToXls()
 
Dim EachFile As String
Dim FileLocation
Dim MyFile As Object
Dim FileCount As Long
Application.ScreenUpdating = False
Application.EnableEvents = False
 
    FileLocation = Application.GetOpenFilename( _
                fileFilter:="Pick any wk4 file (*.wk4, *.wk4")
    
    If FileLocation = False Then Exit Sub
    FileLocation = Left(FileLocation, InStrRev(FileLocation, "\") - 1)
    
    EachFile = Dir(FileLocation & "\*.wk4")
    
    Do While EachFile <> ""   ' Start the loop.
    FileCount = FileCount + 1
            EachFile = FileLocation & "\" & EachFile
            Set MyFile = Workbooks.Open(EachFile, False)
        MyFile.SaveAs ThisWorkbook.Path & "\" & Left(MyFile.Name, Len(MyFile.Name) - 4) & ".xls", xlExcel7
nxt:
       MyFile.Close False
       EachFile = Dir    ' Get next xls file
    Loop
Application.ScreenUpdating = True
Application.EnableEvents = True
MsgBox FileCount & " wk4 file(s) have been converted to Excel format and saved in: " & ThisWorkbook.Path
Exit Sub
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,734
Messages
6,126,543
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top