PDA

View Full Version : Solved: file name extensions



Phelony
04-24-2009, 05:52 AM
Hi guys

This is alarmingly simple I know, but having trawled the net and attempted several different lines, I can't get the following to save as a binary workbook. (Several chunky macros and a small library of coding, drop downs and static data have resulted in a workbook that's 22mb when empty :eek: so binary is the way to go to spare the sanity of my IT guys!)

Sheets("Input Sheet Relationship").Select
Filename = range("D2")
ActiveWorkbook.SaveAs Filename:=Filename
FileExtStr = ".xlsb": FileFormatNum = 50

It's the last line, I know I've screwed it up somehow but I have no idea how. :doh:

:help please!

Thanks

Phel x

GTO
04-24-2009, 05:59 AM
Sheets("Input Sheet Relationship").Select
Filename = range("D2")
ActiveWorkbook.SaveAs Filename:=Filename, _
FileExtStr = ".xlsb": FileFormatNum = 50


I don't have 2007, but as shown, I didn't see a comma or space+underscore (line continuation)

Also, (again, maybe different for 07) does the string in the cell include the ext?

Hope thai helps,

Mark

Phelony
04-24-2009, 06:05 AM
Yes, the last line is the extension.

I'm getting a syntax error now though? :banghead:

Px

GTO
04-24-2009, 06:20 AM
Oops. There's also a missing colon. FileExtStr:=

Phelony
04-24-2009, 06:59 AM
Ah! Superb, thanks for that.

Sadly, after some testing, it turns out that binary saving doesn't preserve the macros for some reason :mkay so it's back to the drawing board on that score.

But thank you for the help all the same. :thumb

Phel x