• drive name when saving .xlsx file

    From timepro timesheet@21:1/5 to All on Wed Apr 14 04:20:55 2021
    hello all:

    is the drive name required while saving .xlsx file?

    oexcel=createobject('excel.application')
    *
    cdest=diskname()+':\tax\gstrepo\'+alltrim(gxlsname)+'.xlsm' && this processes & saves
    *
    cdest='\tax\gstrepo\'+alltrim(gxlsname)+'.xlsm' && this crashes
    *
    oexcel:workbooks:open(cdest) && crashes at thie line

    :error log
    |Error excel.application:WORKBOOKS/14 DISP_E_BADPARAMCOUNT: OPEN Arguments: ( [ |
    |1] = Type: C Val: \tax\gstrepo\XX-GSTR3Bapr21.xlsm) | | |
    |Error at ...: TOLEAUTO:OPEN(0) in Module: |

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From PARESH VALIA@21:1/5 to All on Wed Apr 14 04:50:32 2021
    in main.prg
    setdefault='\tax\'+compani
    set defa to &setdefault

    -for my app, in the mapping for networking/lan, the client only has to share the 'TAX' folder of the drive in the server where my app is installed (and by default all subfolders under TAX are shared too...e.g. \TAX\GSTREPO)
    so, i coded as CDEST='\tax\gstrepo\'+alltrim(gxlsname)+'.xlsm' 'instead' as diskname()+':\tax\gs...
    -also, i checked, gxlsname.xlsm does exist in the \tax\gstrepo\ folder.

    - if i share the entire drive of the server where my app is installed, the user will be able to then have access to other folders/files in the shared drive of the server...

    thank you

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Enrico Maria Giordano@21:1/5 to All on Wed Apr 14 14:36:21 2021
    Il 14/04/2021 13:20, timepro timesheet ha scritto:

    is the drive name required while saving .xlsx file?

    Yes, it is.

    EMG

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From timepro timesheet@21:1/5 to Enrico Maria Giordano on Wed Apr 14 06:53:15 2021
    On Wednesday, April 14, 2021 at 6:06:26 PM UTC+5:30, Enrico Maria Giordano wrote:
    Il 14/04/2021 13:20, timepro timesheet ha scritto:

    is the drive name required while saving .xlsx file?
    Yes, it is.

    EMG

    http://www.emagsoftware.it
    http://www.emagsoftware.it/emgmusic
    http://www.emagsoftware.it/spectrum
    http://www.emagsoftware.it/tbosg

    thanks emg

    in my other app, i do not prefix the drive letter.
    it works ok.

    xlsname='\time\'+xlsfolder+'\'+xlsname && notice - no drive letter xstart=time();freezerow="4"
    oexcel=createobject('excel.application') && HOW TO CHECK IF EXCEL IS LOCALLY INSTALLED OR IT IS OFFICE365 EXCEL
    oexcel:workbooks:add()
    osheet=oexcel:activesheet
    if !empty(xsheetname);osheet:name:=xsheetname;end

    do while ...condition.and.!eof()
    ...
    ...
    skip
    end

    oexcel:activeworkbook:saveas(xlsname)
    oexcel:workbooks:open(xlsname)
    osheet=oexcel:activesheet()
    osheet:rows(freezerow):select()
    oexcel:activewindow:freezepanes=.t.
    oexcel:visible=.t.

    could it be:
    -in my earlier example the .xlsm file was already existing & i was opening it (before the report process) & writing to it.
    -in the above example, the .xlsx file was 'created' after the process is over. [ oexcel:activeworkbook:saveas(xlsname) ]

    thanks for reading

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)