Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

opening file type default

2 views
Skip to first unread message

Joy

unread,
Jul 3, 2003, 2:07:54 PM7/3/03
to
Does anyone know if you can change the default so when you
1st open a file the type automatically will come up to all
files - instead of having to change it to all files each
time you open excel?

Thanks!!!! I am trying to convert alot of lotus files to
excel.

Dave Peterson

unread,
Jul 3, 2003, 5:41:13 PM7/3/03
to
How about just having a macro that prompts you to click on all the .wk* files
you want to convert, then opens each and saves in the same location with .xls as
the extension?

If yes:

Option Explicit
Sub BulkConvert()

Dim InFileNames As Variant
Dim OutFileName As String
Dim fCtr As Long
Dim tempWkbk As Workbook

InFileNames = Application.GetOpenFilename _
(FileFilter:="Lotus WK? Files ,*.wk*", MultiSelect:=True)

Application.ScreenUpdating = False

If IsArray(InFileNames) Then
For fCtr = LBound(InFileNames) To UBound(InFileNames)
If LCase(Right(InFileNames(fCtr), 4)) Like ".wk?" Then
Application.StatusBar = "processing: " & InFileNames(fCtr)
Set tempWkbk = Workbooks.Open(Filename:=InFileNames(fCtr))
OutFileName = Left(InFileNames(fCtr), _
Len(InFileNames(fCtr)) - 4) & ".xls"
Application.DisplayAlerts = False
tempWkbk.SaveAs Filename:=OutFileName, FileFormat:=xlNormal
Application.DisplayAlerts = True
tempWkbk.Close savechanges:=False
Else
Beep
MsgBox "Just .wk? files, please!" & vbLf & _
InFileNames(fCtr) & " Not converted!"
End If
Next fCtr
Else
MsgBox "No file selected"
End If

With Application
.StatusBar = False
.ScreenUpdating = True
End With

End Sub

Start a new workbook.
Hit alt-f11 to get to the vbe
hit ctrl-R to see the project explorer
Find your project.
It should look like: VBAProject (book1)
right click on it and choose insert|module
Paste that code into the right hand window.

Alt-F11 to go back to Excel
Save this file with a nice name.

Now back to excel.

View|toolbars
show the Forms toolbar
click on the icon that looks like a button.
Drag a nice big button on the worksheet. When you let go, you'll be prompted
for a macro to assign. Choose the one you just pasted in (bulkconvert)

Edit the button's caption (and add some instructions so you remember what this
is used for on the worksheet).

When ever you want to convert some workbooks, open this file, click on the
button and select your files.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--

Dave Peterson
ec3...@msn.com

0 new messages