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
 
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.
I'll try to help you. I've just removed the looping parts of the code you posted, something like this with a bit of tidying up:
Code:
Option Explicit

Sub ConvWk4ToXls()
 
    Dim WK4FilePath As Variant
    Dim XLSWorkbook As Workbook
    Dim XLSFilePath As String
    
    WK4FilePath = Application.GetOpenFilename(fileFilter:="Pick any wk4 file (*.wk4),*.wk4")
    
    If WK4FilePath <> False Then
        Set XLSWorkbook = Workbooks.Open(WK4FilePath, False)
        XLSWorkbook.SaveAs XLSWorkbook.Path & "\" & Left(XLSWorkbook.Name, Len(XLSWorkbook.Name) - 4) & ".xls", xlExcel7
        XLSFilePath = XLSWorkbook.FullName
        XLSWorkbook.Close False
        MsgBox WK4FilePath & vbNewLine & "has been converted to Excel format and saved in" & vbNewLine & XLSFilePath
    End If
    
End Sub
What do you mean by "we need to add delimited to the code"?
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
The wk4 when i dowloaded has cells as text, so we need to to text to columns-delimited

I'll try to help you. I've just removed the looping parts of the code you posted, something like this with a bit of tidying up:
Code:
Option Explicit
 
Sub ConvWk4ToXls()
 
    Dim WK4FilePath As Variant
    Dim XLSWorkbook As Workbook
    Dim XLSFilePath As String
 
    WK4FilePath = Application.GetOpenFilename(fileFilter:="Pick any wk4 file (*.wk4),*.wk4")
 
    If WK4FilePath <> False Then
        Set XLSWorkbook = Workbooks.Open(WK4FilePath, False)
        XLSWorkbook.SaveAs XLSWorkbook.Path & "\" & Left(XLSWorkbook.Name, Len(XLSWorkbook.Name) - 4) & ".xls", xlExcel7
        XLSFilePath = XLSWorkbook.FullName
        XLSWorkbook.Close False
        MsgBox WK4FilePath & vbNewLine & "has been converted to Excel format and saved in" & vbNewLine & XLSFilePath
    End If
 
End Sub
What do you mean by "we need to add delimited to the code"?
 
Upvote 0
I am on XP Pro 03 .xls and OS

when I try to access .wk4 files defaults to the "Registery Policy Setting" not allowing this process.

Any solutions?
txs
Gene
 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,407
Members
449,448
Latest member
Andrew Slatter

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