Jump to content

[REQ] Need help with Excel code.


Bill Bundle

Recommended Posts

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.

Link to comment
Share on other sites

@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"
Link to comment
Share on other sites

@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 by Bill Bundle
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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.

 

attachment.php?attachmentid=14&stc=1

Compile_Error.jpg.87c57a7eedb3f3fa378b2996e9d90342.jpg

Edited by Bill Bundle
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

@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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...