downloaded file from SAP can't open using VBA

  • Data from SAP.


    The objective open the excel data and copy to my main excel


    MyPath = Application.Path & "" & "BT.xlsx


    Workbooks("BT.xlsx").Activate <---- U got debug issue can't find the path
    Sheets("Sheet1").Select
    ActiveSheet.Copy After:=Workbooks("Raw.xlsm").Sheets("existingRaw") ' ~~ This is file and sheet name ~~

  • Re: downloaded file from SAP can't open using VBA


    Quote from norie;791300

    Are you sure the file is being downloaded to the directory where the Excel application is stored?


    yup, if I used default path Workbooks.Open "C:\Next\forward\folder\name\BT.XLSX", my file open auto and transfer to my main file

  • Re: downloaded file from SAP can't open using VBA


    Sorry I don't understand.


    When you use Application.Path the code doesn't work but when you use "C:\Next\forward\folder\name" it does work, so why are you using Application.Path?

    Boo!:yikes:

  • Re: downloaded file from SAP can't open using VBA


    yes correct, because I noticed when my sap download file path changed, my VBA, I got debug error in my default path, so I want dynamic.

  • Re: downloaded file from SAP can't open using VBA


    Why use Application.Path though?


    That's the path to the Excel application, I doubt very much that files would be downloaded to there.

    Boo!:yikes:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!