Regarding using of Automation variable and saving the same

pri_1_ranjanpri_1_ranjan Member Posts: 67
Here i am trying to export the date from 'Jnl line' to the excel sheet .
But in order to complete the work i have to save the same in some specified path .
Now, here the problem arises . I am able to create xl application , and the file by default it gets stored into My Document Folder. Further more if i want to change the extension to 'DBF' files then what is suggested

My worry is where and what to assign the path and how to change the file format at the run time .

Please help me out .......
/PDR

Comments

  • ArhontisArhontis Member Posts: 667
    Hi,

    Maybe this could help. The code in VBA is:
    ActiveWorkbook.SaveAs Filename:="C:\Book1.dbf", FileFormat:=xlDBF4
    
    Try to use a 'Microsoft Excel 11.0 Object Library'.Workbook variable and excute the SaveAs method with the help of the above variables.

    Maybe something like this:
    XlWorkBook := XLApp.ActiveWorkbook;
    XlWorkBook.SaveAs('C:\Book1.dbf','xlDBF4');
    

    You can find the method in the C/AL symbol menu and maybe you should use variants instead of test on the parameters of the SaveAs method.
Sign In or Register to comment.