Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default checkcompatibility not working in Windows 7

I have an Excel macro that I use on several PCs. The macro uses the SaveAs
method to save a copy of the sheet as a separate workbook. The macro code
contains the code:

activeworkbook.checkcompatibility = false
activeworkbook.saveas ...

On PCs running XP and both Office 2003 and Office 2007 it saves the copy
without incident. On a PC running Office 2007 and Windows-7, it always
displays the Compatibility Checker warning. Also, after the SaveAs on the
Win-7 platform has executed, I notice that CheckCompatibility is set to true
again.

Any ideas how to prevent Win-7 from resetting the CheckCompatibility flag?

Thanks
--
cw
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default checkcompatibility not working in Windows 7


Hi Charlie

The problem is the default save format
See the example on this page and let me know if it is also working for you
http://www.rondebruin.nl/saveas.htm


--

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


"Charlie W" wrote in message ...
I have an Excel macro that I use on several PCs. The macro uses the SaveAs
method to save a copy of the sheet as a separate workbook. The macro code
contains the code:

activeworkbook.checkcompatibility = false
activeworkbook.saveas ...

On PCs running XP and both Office 2003 and Office 2007 it saves the copy
without incident. On a PC running Office 2007 and Windows-7, it always
displays the Compatibility Checker warning. Also, after the SaveAs on the
Win-7 platform has executed, I notice that CheckCompatibility is set to true
again.

Any ideas how to prevent Win-7 from resetting the CheckCompatibility flag?

Thanks
--
cw

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default checkcompatibility not working in Windows 7

Ron. Thanks for the quick reply. Not sure this is the
problem. The actual line of code in question is:

ActiveWorkbook.SaveAs Filename:=SaveName, _
FileFormat:=xlWorkbookNormal

In the cases I have been trying, the 'SaveName' is a full
path name of the form "C:\....filename.xls"

I wanted to use .xls file extensions because lots of folks
who receive the saved files still run office 2003. And
office 2003, even with the compatibility pack, seems to
'complain' about opening attachments saved with
'.xls' file extensions using other file formats.

I selected that xlWorkbookNormal as one format that
seemed to work best in both office 2003 and 2007.

Did I not fully understand what the explanation at the
URL you provided was saying?
--
cw


"Ron de Bruin" wrote:


Hi Charlie

The problem is the default save format
See the example on this page and let me know if it is also working for you
http://www.rondebruin.nl/saveas.htm


--

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


"Charlie W" wrote in message ...
I have an Excel macro that I use on several PCs. The macro uses the SaveAs
method to save a copy of the sheet as a separate workbook. The macro code
contains the code:

activeworkbook.checkcompatibility = false
activeworkbook.saveas ...

On PCs running XP and both Office 2003 and Office 2007 it saves the copy
without incident. On a PC running Office 2007 and Windows-7, it always
displays the Compatibility Checker warning. Also, after the SaveAs on the
Win-7 platform has executed, I notice that CheckCompatibility is set to true
again.

Any ideas how to prevent Win-7 from resetting the CheckCompatibility flag?

Thanks
--
cw

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default checkcompatibility not working in Windows 7

No you not understand it correct

In 2007 you must use FileFormat:=56
for a 97-2003 workbook

Try the macro below from my site to create a workbook with the activesheet and save it as
97-2003 format in your Application.DefaultFilePath (Documents folder)

Sub Save_2007_WorkSheet_As_97_2003_Workbook()
'Avoid CheckCompatibility dialog when you copy a WorkSheet
'from a 2007-2010 file with things that are new in 2007-2010
'to a new workbook and save this workbook as a 97-2003 workbook
Dim Destwb As Workbook
Dim SaveFormat As Long
Dim TempFilePath As String
Dim TempFileName As String

'Remember the users setting
SaveFormat = Application.DefaultSaveFormat
'Set it to the 97-2003 file format
Application.DefaultSaveFormat = 56

ActiveSheet.Copy
Set Destwb = ActiveWorkbook
Destwb.CheckCompatibility = False

'Save the new workbook and close it
TempFilePath = Application.DefaultFilePath & "\"
TempFileName = "97-2003 WorkBook " & Format(Now, "yyyy-mm-dd hh-mm-ss")

With Destwb
.SaveAs TempFilePath & TempFileName & ".xls", FileFormat:=56
.Close SaveChanges:=False
End With

'Set DefaultSaveFormat back to the users setting
Application.DefaultSaveFormat = SaveFormat
End Sub

--

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


"Charlie W" wrote in message ...
Ron. Thanks for the quick reply. Not sure this is the
problem. The actual line of code in question is:

ActiveWorkbook.SaveAs Filename:=SaveName, _
FileFormat:=xlWorkbookNormal

In the cases I have been trying, the 'SaveName' is a full
path name of the form "C:\....filename.xls"

I wanted to use .xls file extensions because lots of folks
who receive the saved files still run office 2003. And
office 2003, even with the compatibility pack, seems to
'complain' about opening attachments saved with
'.xls' file extensions using other file formats.

I selected that xlWorkbookNormal as one format that
seemed to work best in both office 2003 and 2007.

Did I not fully understand what the explanation at the
URL you provided was saying?
--
cw


"Ron de Bruin" wrote:


Hi Charlie

The problem is the default save format
See the example on this page and let me know if it is also working for you
http://www.rondebruin.nl/saveas.htm


--

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


"Charlie W" wrote in message ...
I have an Excel macro that I use on several PCs. The macro uses the SaveAs
method to save a copy of the sheet as a separate workbook. The macro code
contains the code:

activeworkbook.checkcompatibility = false
activeworkbook.saveas ...

On PCs running XP and both Office 2003 and Office 2007 it saves the copy
without incident. On a PC running Office 2007 and Windows-7, it always
displays the Compatibility Checker warning. Also, after the SaveAs on the
Win-7 platform has executed, I notice that CheckCompatibility is set to true
again.

Any ideas how to prevent Win-7 from resetting the CheckCompatibility flag?

Thanks
--
cw

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default checkcompatibility not working in Windows 7

I get it now.

Thanks a lot.
--
cw


"Ron de Bruin" wrote:

No you not understand it correct

In 2007 you must use FileFormat:=56
for a 97-2003 workbook

Try the macro below from my site to create a workbook with the activesheet and save it as
97-2003 format in your Application.DefaultFilePath (Documents folder)

Sub Save_2007_WorkSheet_As_97_2003_Workbook()
'Avoid CheckCompatibility dialog when you copy a WorkSheet
'from a 2007-2010 file with things that are new in 2007-2010
'to a new workbook and save this workbook as a 97-2003 workbook
Dim Destwb As Workbook
Dim SaveFormat As Long
Dim TempFilePath As String
Dim TempFileName As String

'Remember the users setting
SaveFormat = Application.DefaultSaveFormat
'Set it to the 97-2003 file format
Application.DefaultSaveFormat = 56

ActiveSheet.Copy
Set Destwb = ActiveWorkbook
Destwb.CheckCompatibility = False

'Save the new workbook and close it
TempFilePath = Application.DefaultFilePath & "\"
TempFileName = "97-2003 WorkBook " & Format(Now, "yyyy-mm-dd hh-mm-ss")

With Destwb
.SaveAs TempFilePath & TempFileName & ".xls", FileFormat:=56
.Close SaveChanges:=False
End With

'Set DefaultSaveFormat back to the users setting
Application.DefaultSaveFormat = SaveFormat
End Sub

--

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


"Charlie W" wrote in message ...
Ron. Thanks for the quick reply. Not sure this is the
problem. The actual line of code in question is:

ActiveWorkbook.SaveAs Filename:=SaveName, _
FileFormat:=xlWorkbookNormal

In the cases I have been trying, the 'SaveName' is a full
path name of the form "C:\....filename.xls"

I wanted to use .xls file extensions because lots of folks
who receive the saved files still run office 2003. And
office 2003, even with the compatibility pack, seems to
'complain' about opening attachments saved with
'.xls' file extensions using other file formats.

I selected that xlWorkbookNormal as one format that
seemed to work best in both office 2003 and 2007.

Did I not fully understand what the explanation at the
URL you provided was saying?
--
cw


"Ron de Bruin" wrote:


Hi Charlie

The problem is the default save format
See the example on this page and let me know if it is also working for you
http://www.rondebruin.nl/saveas.htm


--

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


"Charlie W" wrote in message ...
I have an Excel macro that I use on several PCs. The macro uses the SaveAs
method to save a copy of the sheet as a separate workbook. The macro code
contains the code:

activeworkbook.checkcompatibility = false
activeworkbook.saveas ...

On PCs running XP and both Office 2003 and Office 2007 it saves the copy
without incident. On a PC running Office 2007 and Windows-7, it always
displays the Compatibility Checker warning. Also, after the SaveAs on the
Win-7 platform has executed, I notice that CheckCompatibility is set to true
again.

Any ideas how to prevent Win-7 from resetting the CheckCompatibility flag?

Thanks
--
cw
.

.

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
Excel Files Stopped working in windows 7 vamsi Excel Discussion (Misc queries) 0 February 24th 10 05:46 AM
2007: CheckCompatibility not honored Mark Olbert Excel Programming 2 July 15th 07 07:47 PM
Windows.RangeFromPoint method is not working properly Raja Excel Programming 5 April 23rd 07 09:36 AM
Windows in Taskbar not working VT Excel Discussion (Misc queries) 3 May 31st 05 08:48 PM


All times are GMT +1. The time now is 07:55 PM.

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"