Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
save as version 2003 problem
I'm working in vba in Access to create and save an Excel file. All's good
except that one of the workstations this is runnign on is using Office 2007. I'm developing in 2003 and all the other workstatiosn they have are using 2003. It's very important that the files be saved in 2003 format. When I do this, it runs fine and saves as 97/95 objExcelBk.SaveAs sTempPath & sExcelFileName, xlExcel9795 ','56 = xl 2000/2003 I read online in a forum post that "56" is the correct code for saving as 2003 but that's when the code is written in 2007. I cannot find a constant in the list of constants in 2003 to save as 2003 (like xlExcel0003 for example) and the "56" below causes the code to crash. objExcelBk.SaveAs sTempPath & sExcelFileName, 56 I may end up having to use xlExcel9795 and I think that will be okay but how do I code this to ensure saving as 2003 format while writing the code in 2003? Thanks, Keith |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
save as version 2003 problem
Well to make this worse, I just learned that 2007 does not support saving as
95/97 so I'm guessing that if someone using Office 2007 runs my code that has xlExcel9795 in it then they will get an error too. "Keith G Hicks" wrote in message ... I'm working in vba in Access to create and save an Excel file. All's good except that one of the workstations this is runnign on is using Office 2007. I'm developing in 2003 and all the other workstatiosn they have are using 2003. It's very important that the files be saved in 2003 format. When I do this, it runs fine and saves as 97/95 objExcelBk.SaveAs sTempPath & sExcelFileName, xlExcel9795 ','56 = xl 2000/2003 I read online in a forum post that "56" is the correct code for saving as 2003 but that's when the code is written in 2007. I cannot find a constant in the list of constants in 2003 to save as 2003 (like xlExcel0003 for example) and the "56" below causes the code to crash. objExcelBk.SaveAs sTempPath & sExcelFileName, 56 I may end up having to use xlExcel9795 and I think that will be okay but how do I code this to ensure saving as 2003 format while writing the code in 2003? Thanks, Keith |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
save as version 2003 problem
I think this will solve the problem. Any feedback?
Dim lCurrXlVersion As Long lCurrXlVersion = objExcelApp.Version objExcelApp.DisplayAlerts = False Select Case lCurrXlVersion Case 11 objExcelBk.SaveAs sTempPath & sExcelFileName Case 12, 14 objExcelBk.SaveAs sTempPath & sExcelFileName, 56 '56 = xl 2000/2003 Case Else MsgBox "Error saving Excel file because you are not using version 2003, 2007 or 2010" End Select "Keith G Hicks" wrote in message ... Well to make this worse, I just learned that 2007 does not support saving as 95/97 so I'm guessing that if someone using Office 2007 runs my code that has xlExcel9795 in it then they will get an error too. "Keith G Hicks" wrote in message ... I'm working in vba in Access to create and save an Excel file. All's good except that one of the workstations this is runnign on is using Office 2007. I'm developing in 2003 and all the other workstatiosn they have are using 2003. It's very important that the files be saved in 2003 format. When I do this, it runs fine and saves as 97/95 objExcelBk.SaveAs sTempPath & sExcelFileName, xlExcel9795 ','56 = xl 2000/2003 I read online in a forum post that "56" is the correct code for saving as 2003 but that's when the code is written in 2007. I cannot find a constant in the list of constants in 2003 to save as 2003 (like xlExcel0003 for example) and the "56" below causes the code to crash. objExcelBk.SaveAs sTempPath & sExcelFileName, 56 I may end up having to use xlExcel9795 and I think that will be okay but how do I code this to ensure saving as 2003 format while writing the code in 2003? Thanks, Keith |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
save as version 2003 problem
See
http://www.rondebruin.nl/saveas.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Keith G Hicks" wrote in message ... I think this will solve the problem. Any feedback? Dim lCurrXlVersion As Long lCurrXlVersion = objExcelApp.Version objExcelApp.DisplayAlerts = False Select Case lCurrXlVersion Case 11 objExcelBk.SaveAs sTempPath & sExcelFileName Case 12, 14 objExcelBk.SaveAs sTempPath & sExcelFileName, 56 '56 = xl 2000/2003 Case Else MsgBox "Error saving Excel file because you are not using version 2003, 2007 or 2010" End Select "Keith G Hicks" wrote in message ... Well to make this worse, I just learned that 2007 does not support saving as 95/97 so I'm guessing that if someone using Office 2007 runs my code that has xlExcel9795 in it then they will get an error too. "Keith G Hicks" wrote in message ... I'm working in vba in Access to create and save an Excel file. All's good except that one of the workstations this is runnign on is using Office 2007. I'm developing in 2003 and all the other workstatiosn they have are using 2003. It's very important that the files be saved in 2003 format. When I do this, it runs fine and saves as 97/95 objExcelBk.SaveAs sTempPath & sExcelFileName, xlExcel9795 ','56 = xl 2000/2003 I read online in a forum post that "56" is the correct code for saving as 2003 but that's when the code is written in 2007. I cannot find a constant in the list of constants in 2003 to save as 2003 (like xlExcel0003 for example) and the "56" below causes the code to crash. objExcelBk.SaveAs sTempPath & sExcelFileName, 56 I may end up having to use xlExcel9795 and I think that will be okay but how do I code this to ensure saving as 2003 format while writing the code in 2003? Thanks, Keith |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
save as version 2003 problem
That's where I got some of the code I'm using but it only works if you are
running it in 2007/2010. If you try to do this: objExcelBk.SaveAs sTempPath & sExcelFileName, 56 in Access 2003 vba, it doesn't run because "56" is not a valid version # as far as vba 2003 is concerned. "Ron de Bruin" wrote in message ... See http://www.rondebruin.nl/saveas.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Keith G Hicks" wrote in message ... I think this will solve the problem. Any feedback? Dim lCurrXlVersion As Long lCurrXlVersion = objExcelApp.Version objExcelApp.DisplayAlerts = False Select Case lCurrXlVersion Case 11 objExcelBk.SaveAs sTempPath & sExcelFileName Case 12, 14 objExcelBk.SaveAs sTempPath & sExcelFileName, 56 '56 = xl 2000/2003 Case Else MsgBox "Error saving Excel file because you are not using version 2003, 2007 or 2010" End Select "Keith G Hicks" wrote in message ... Well to make this worse, I just learned that 2007 does not support saving as 95/97 so I'm guessing that if someone using Office 2007 runs my code that has xlExcel9795 in it then they will get an error too. "Keith G Hicks" wrote in message ... I'm working in vba in Access to create and save an Excel file. All's good except that one of the workstations this is runnign on is using Office 2007. I'm developing in 2003 and all the other workstatiosn they have are using 2003. It's very important that the files be saved in 2003 format. When I do this, it runs fine and saves as 97/95 objExcelBk.SaveAs sTempPath & sExcelFileName, xlExcel9795 ','56 = xl 2000/2003 I read online in a forum post that "56" is the correct code for saving as 2003 but that's when the code is written in 2007. I cannot find a constant in the list of constants in 2003 to save as 2003 (like xlExcel0003 for example) and the "56" below causes the code to crash. objExcelBk.SaveAs sTempPath & sExcelFileName, 56 I may end up having to use xlExcel9795 and I think that will be okay but how do I code this to ensure saving as 2003 format while writing the code in 2003? Thanks, Keith |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
save as version 2003 problem
Do you say that the macro example from my site is not working if you run it in 2003
-- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Keith G Hicks" wrote in message ... That's where I got some of the code I'm using but it only works if you are running it in 2007/2010. If you try to do this: objExcelBk.SaveAs sTempPath & sExcelFileName, 56 in Access 2003 vba, it doesn't run because "56" is not a valid version # as far as vba 2003 is concerned. "Ron de Bruin" wrote in message ... See http://www.rondebruin.nl/saveas.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Keith G Hicks" wrote in message ... I think this will solve the problem. Any feedback? Dim lCurrXlVersion As Long lCurrXlVersion = objExcelApp.Version objExcelApp.DisplayAlerts = False Select Case lCurrXlVersion Case 11 objExcelBk.SaveAs sTempPath & sExcelFileName Case 12, 14 objExcelBk.SaveAs sTempPath & sExcelFileName, 56 '56 = xl 2000/2003 Case Else MsgBox "Error saving Excel file because you are not using version 2003, 2007 or 2010" End Select "Keith G Hicks" wrote in message ... Well to make this worse, I just learned that 2007 does not support saving as 95/97 so I'm guessing that if someone using Office 2007 runs my code that has xlExcel9795 in it then they will get an error too. "Keith G Hicks" wrote in message ... I'm working in vba in Access to create and save an Excel file. All's good except that one of the workstations this is runnign on is using Office 2007. I'm developing in 2003 and all the other workstatiosn they have are using 2003. It's very important that the files be saved in 2003 format. When I do this, it runs fine and saves as 97/95 objExcelBk.SaveAs sTempPath & sExcelFileName, xlExcel9795 ','56 = xl 2000/2003 I read online in a forum post that "56" is the correct code for saving as 2003 but that's when the code is written in 2007. I cannot find a constant in the list of constants in 2003 to save as 2003 (like xlExcel0003 for example) and the "56" below causes the code to crash. objExcelBk.SaveAs sTempPath & sExcelFileName, 56 I may end up having to use xlExcel9795 and I think that will be okay but how do I code this to ensure saving as 2003 format while writing the code in 2003? Thanks, Keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save Excel 2003 to earlier version | Excel Discussion (Misc queries) | |||
Excel 2003 save as earlier version | Excel Discussion (Misc queries) | |||
How do I save an Excel 97-2003 version or 2007 version for Mac 200 | Excel Discussion (Misc queries) | |||
new 2007 compatibliity - can't save to 2003 version | New Users to Excel | |||
How do I save a 2003 version macro in separate folder for other u. | Excel Programming |