Bill Bundle Posted September 7, 2017 Report Share Posted September 7, 2017 If anyone here knows how to program VBA in MS Excel, please help. I'd like to use the code in this article, but there's some errors in it. Please help to correct the errors and post it somewhere for downloading. Thanks. Free NSE Intraday Backfill Data from Google Finance https://liveniftytrading.wordpress.com/2015/05/29/free-nse-intraday-backfill-data-from-google-finance/comment-page-1/#comment-40 Google Backfill Dowloader Excel Sheet https://drive.google.com/file/d/0B-xd75dzcMThYWJzcmJjcWhBZ2M/view?usp=sharing Quote Link to comment Share on other sites More sharing options...
⭐ FFRT Posted September 8, 2017 Report Share Posted September 8, 2017 @Bill Bundle, What error you are getting ? Do note that, you have to define the file location, where output file will be saved in csv format. By default, Output file location is - D:\TRADING\NSE EOD Data Downloader v2.2\Eod\ Either create it on your machine in above style, else define you custom path (say you want D:\DATA) then you open the VBA editor (Alt+F11) - Goto Module1 -> find Procedure "ExportGoogleDataToCsv" at Line 220 change the file path to CSVFile = "D:\DATA\GoogleBackfill " & todaydate & ".csv" Quote Link to comment Share on other sites More sharing options...
Bill Bundle Posted September 8, 2017 Author Report Share Posted September 8, 2017 (edited) @FFRT Thanks, but have you tried it and it works? I changed the path as you recommended, but I get a compile error and it's not on the file path. It's in the Range2CSV function. Why is there an error there? I'm using x64 bit 2016 Excel. How do you get line numbers in the code? @Bill Bundle, What error you are getting ? Do note that, you have to define the file location, where output file will be saved in csv format. By default, Output file location is - D:\TRADING\NSE EOD Data Downloader v2.2\Eod\ Either create it on your machine in above style, else define you custom path (say you want D:\DATA) then you open the VBA editor (Alt+F11) - Goto Module1 -> find Procedure "ExportGoogleDataToCsv" at Line 220 change the file path to Edited September 8, 2017 by Bill Bundle Quote Link to comment Share on other sites More sharing options...
⭐ FFRT Posted September 8, 2017 Report Share Posted September 8, 2017 yes, i tried, it works in Win8.1 64 bit. Any screenshots showing your error please. Since you are referring to Range2CSV, I'm suggesting, possibly may not be correct with half understood query, are you trying to pull more than 100 symbols? Its current Name Range is restricted to 100 symbols only, but if you wish to add more, you can modify the range from Formulas->Name Manager-> and refer to REFERENCE where "Mystock list" towards end is defined, and modify the range. P.S.:It works for more than 100 symbols, as well. Quote Link to comment Share on other sites More sharing options...
Bill Bundle Posted September 8, 2017 Author Report Share Posted September 8, 2017 (edited) @FFRT, See screenshot below. I'm only testing one ticker. Here is the file that I'm working with. https://www.expirebox.com/download/3ea2f666c1a9491832c02a944f6c54e1.html yes, i tried, it works in Win8.1 64 bit. Any screenshots showing your error please. Since you are referring to Range2CSV, I'm suggesting, possibly may not be correct with half understood query, are you trying to pull more than 100 symbols? Its current Name Range is restricted to 100 symbols only, but if you wish to add more, you can modify the range from Formulas->Name Manager-> and refer to REFERENCE where "Mystock list" towards end is defined, and modify the range. P.S.:It works for more than 100 symbols, as well. Edited September 8, 2017 by Bill Bundle Quote Link to comment Share on other sites More sharing options...
swandro Posted September 8, 2017 Report Share Posted September 8, 2017 @FFRT, See screenshot below. I'm only testing one ticker. Here is the file that I'm working with. https://www.expirebox.com/download/3ea2f666c1a9491832c02a944f6c54e1.html The highlighted bit should be RangeCSV - the same name as the function. Quote Link to comment Share on other sites More sharing options...
Bill Bundle Posted September 8, 2017 Author Report Share Posted September 8, 2017 Yes it is. The loop is accumulating the list into a variable named "tmp" and the list content is then assigned to the function "RangeCSV". So why is there an error? Does have anything to do with Windows 10 x64 that I'm using? The highlighted bit should be RangeCSV - the same name as the function. Quote Link to comment Share on other sites More sharing options...
⭐ FFRT Posted September 9, 2017 Report Share Posted September 9, 2017 (edited) No, as your error says, "Variable not defined". It has nothing to do with function name. Are you using any function directly, or from its parameter sheet you are selecting to download? I dont get any errors. Edited September 9, 2017 by FFRT Quote Link to comment Share on other sites More sharing options...
Bill Bundle Posted September 9, 2017 Author Report Share Posted September 9, 2017 @FFRT I'm using the spreadsheet just as I downloaded it. The only change that I made was to the download path that you suggested. I'll have to check if my system has all the necessary Windows .NET utilities that the Office system requires. I cannot think of anything else. No, as your error says, "Variable not defined". It has nothing to do with function name. Are you using any function directly, or from its parameter sheet you are selecting to download? I dont get any errors. Quote Link to comment Share on other sites More sharing options...
Bill Bundle Posted September 9, 2017 Author Report Share Posted September 9, 2017 Well my .NET installation is up to date. Could there be anything else? https://docs.microsoft.com/en-us/dotnet/framework/install/on-windows-10 Quote Link to comment Share on other sites More sharing options...
⭐ FFRT Posted September 11, 2017 Report Share Posted September 11, 2017 Error that you showed only says, "variable" not found.....it is not related to .Net or anything else. I just wonder, if it works at my end, why not working on your machine. Quote Link to comment Share on other sites More sharing options...
Bill Bundle Posted September 11, 2017 Author Report Share Posted September 11, 2017 I'm thinking there must be some VBA utility that didn't load when I installed MS Office and I'm searching the internet for an answer. BTW would you happen to know if the code for MS Excel is the same for Visual Basic 6? I see that VB6 has some utility libraries that might help. Error that you showed only says, "variable" not found.....it is not related to .Net or anything else. I just wonder, if it works at my end, why not working on your machine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.