mibuso.com

Microsoft Business Solutions online community
It is currently Thu Oct 30, 2014 6:29 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: excel 2007 - how to save files as excel 97
PostPosted: Fri Apr 12, 2013 7:12 am 
Offline

Joined: Tue Aug 26, 2003 7:48 am
Posts: 161
Location: Olomouc, Moravia
Country: Czech Republic (cz)
Hello

I have problem with creating excel sheets. I am using excel buffer to fill excel sheet and this code to save prepared excel:
Code: Select all
XlApp.UserControl(TRUE);
XlWrkBk.Close(TRUE,FIleName);
XlApp.Quit;
CLEAR(XlApp);

this code will save prepared excel as default XML format.

our partner who receives excel files has some problem with office 2007 format and requests files in older 97 format.
can anybody tell me, how to change excel format?

I tried to modify my code this way:
Code: Select all
XlApp.UserControl(TRUE);
XlWrkBk.SaveAs(FIleName,'43'); /// save as excel 97
XlWrkBk.Close(FALSE);
XlApp.Quit;
CLEAR(XlApp);

but it did not work. number 43 I took from this document: http://msdn.microsoft.com/en-us/library/office/bb241279(v=office.12).aspx and I tried it as number too.

any information will be most appreciated :)
thanks in advance.

_________________
Martin Bokůvka, Skil Olomouc


Top
 Profile E-mail WWW  
 
 Post subject: Re: excel 2007 - how to save files as excel 97
PostPosted: Fri Apr 12, 2013 9:54 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Fri Jun 06, 2003 8:01 pm
Posts: 7069
Location: L.I., New York
Country: United States (us)
Perhaps you can introduce them to the compatability pack.
Then they won't have trouble opening newer versions of files.

http://office.microsoft.com/en-us/suppo ... 68676.aspx

_________________
Harry Ruiz
http://www.BiloBeauty.com
http://www.autismspeaks.org


Top
 Profile E-mail WWW  
 
 Post subject: Re: excel 2007 - how to save files as excel 97
PostPosted: Mon Apr 15, 2013 6:11 am 
Offline

Joined: Tue Aug 26, 2003 7:48 am
Posts: 161
Location: Olomouc, Moravia
Country: Czech Republic (cz)
yes, I know...
but this is not sending office files to customer with human on other end - it is DB Schenker WMS which processes XLS files automaticaly :(
at this time we created small VB script which is called after XLSX file creation, but I do not like this workaround

_________________
Martin Bokůvka, Skil Olomouc


Top
 Profile E-mail WWW  
 
 Post subject: Re: excel 2007 - how to save files as excel 97
PostPosted: Mon Apr 15, 2013 7:46 am 
Offline

Joined: Tue Aug 26, 2003 7:48 am
Posts: 161
Location: Olomouc, Moravia
Country: Czech Republic (cz)
I am trying to use this vbscript as workaround...
If Iľl run it from saved file, then conversion is performed. but from NAV, execution fails...

Code: Select all
_autVBScript.Language := 'VBScript';
_charCR := 13;
_txtCR := '';
_txtCR[1] := 13;

_txtCode := _txtCode + 'dim objShell' + _txtCR;
_txtCode := _txtCode + 'Set objShell = CreateObject("Wscript.Shell")' + _txtCR;

_txtCode := _txtCode + 'Set objExcel = CreateObject("Excel.Application" )' + _txtCR;
_txtCode := _txtCode + 'Set objWorkbook = objExcel.Workbooks.Open("' +
            _txtXLSXFile + '")' + _txtCR;
_txtCode := _txtCode + 'objExcel.Application.Visible = False' + _txtCR;
_txtCode := _txtCode + 'objExcel.Application.DisplayAlerts = False' + _txtCR;
_txtCode := _txtCode + 'objExcel.ActiveWorkbook.SaveAs ("' +
            COPYSTR(_txtXLSXFile,1,STRLEN(_txtXLSXFile) - 1) + '"), 56' + _txtCR;
_txtCode := _txtCode + 'objExcel.ActiveWorkbook.Close' + _txtCR;
_txtCode := _txtCode + 'objExcel.Application.DisplayAlerts = True' + _txtCR;
_txtCode := _txtCode + 'objExcel.Application.Quit' + _txtCR;
_txtCode := _txtCode + 'WScript.Quit' + _txtCR;
_autVBScript.AddCode(_txtCode);
_autVBScript.ExecuteStatement('OpenFile()' + _txtCR);

for error message please see attached file.
Attachment:
Untitled.png
Untitled.png [ 19.15 KiB | Viewed 622 times ]

any help will be welcomed

_________________
Martin Bokůvka, Skil Olomouc


Top
 Profile E-mail WWW  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google [Bot] and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: