Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default XL07 - How to conditionally determine Workbook file format compatibility in VBA?

Hi Keena

I see no other way on this moment then use the CheckCompatibility dialog in the macro

Something like this that try to save as xls first and if you press cancel it save as xlsm
I try to find another way to test it without answering the dialog with Continue or cancel

Sub test()
On Error Resume Next
With ActiveWorkbook
.SaveAs "C:\Users\Ron\Test\aa.xls", 56
If .Name < "aa.xls" Then
.SaveAs "C:\Users\Ron\Test\aa.xlsm", 52
End If
.Close True
End With
End Sub

I will look for more information this weekend
Maybe others have a better suggestion


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"keeena" wrote in message ups.com...
Thanks for the help...look forward to your reply. Also sent request
to Microsoft.

I hope it doesn't require jumping through hoops...like saving in 2
different formats, opening & comparing.

One thing I've found: a file with XL07 content saved can be saved with
a .XLS extension. Windows & Excel 07 will think file type is 97-2003
due to the extension. However, it will throw a warning upon opening
with XL07...XL07 thinks file is corrupted because content doesn't
match given extension. It will open OK w/ the XL07 content (e.g.
80,000 rows of data).

If its possible to catch this warning/error, then my Save method could
force-save w/ .XLS extension (no FileType specified) and then open the
file. If the warning message pops up, then I know the FileType needs
to be .XLSX.

What I don't know is if I can check for this error/warning. But
someone out there w/ more experience may know...

GL...hope you're able to find *something* that I may be able to use.

-K

On Jul 20, 1:03 pm, "Ron de Bruin" wrote:
Hi keeena

I never looked for this.
If you use workbooks.add it will add a workbook with the format as your default file format in Excel.

I will test/try a few things today/tomorrw and post back

--

Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[XL07] Conditionally format fill color for entire row Trevor Stone Excel Worksheet Functions 11 July 31st 08 10:26 PM
conditionally format anumber format Montana Excel Worksheet Functions 5 January 15th 08 05:25 PM
How to conditionally determine Workbook save compatibility in VBA? keeena Excel Programming 1 July 19th 07 03:01 PM
VBA Access lost after 2007 file format compatibility pack installe roanokesys Excel Discussion (Misc queries) 2 May 24th 07 11:49 AM
Conditionally format Terri Excel Programming 1 November 15th 04 08:06 PM


All times are GMT +1. The time now is 11:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"