Refresh all but input pwd once - excel

I have an excel file with roughli 25 oracle connections that I have to refresh. Each one prompts a usn and password input. I would like a vba that prompts for a usn and password once and inputs it in all following prompts.
I have been searching for a way to do this but can not find a suitable solution.
Thank you all in advance.

"First of all I would like to know if this is even possible."
In short, yes It all comes down to the connection string. How you go about creating and using that string is up to your requirements and your imagination.
"I have been searching for a way to do this but can not find a suitable solution."
Anecdotal evidence suggests a person suffering from this condition failed to do one it more of the following:
ask the right question
recognize the right answer
to have patience or persistence
overcome laziness
access Google
But seriously, I don't know what to tell you, the answer is in comments of the the second link I gave you, Specifically, the third and fourth comment. The third points vaguely toward the connection string and the forth takes you to more helpful commentary.
Refresh a connection in Excel to SQL Server (with password) using VBA
Can I use VBA to "pass" a password to an external database connection in Excel?

Related

Unprotecting VBA Editor Triggers Sub

I password protected my VBA Editor with:
Tools > VBAProject Properties > Protection
Clicked "Lock project for viewing"
Added a password.
What I need to have happen is that when this password prompt is accepted, It needs to run a Sub I've already written.
The answer I'm looking for and can't find in the three books on my desk is:
Is this action a Workbook Event? Or something else? And what syntax can make this happen.
Thanks!
Potential solution from MSDN:
https://msdn.microsoft.com/en-us/library/office/aa165442(v=office.10).aspx
This won't work for for what I'm trying to do. I wrote a script that asks for a key delivered weekly to authorized users via another program. What I wanted is a Sub to run which deletes all of my sensitive data if the user enters an incorrect password while attempting to get to the code.
Looks like this is not possible in Excel VBA... I'll keep learning and searching for a way to do this. If I do I will revisit this post.

Firefox autofill only email

i'm totally new to this kind of practices so maybe i'm going to ask a stupid question, mostly because i couldn't find anything googling around.
I'm using Firefox 36 and i modified it so that it saves my passwords without asking me any time and this works.
But I have a problem with the autofill: I would like Firefox to autofill only the email field if it has a stored password, but that it does not autofill also the password field, so that it behaves like it doesn't have the password stored.
This is because my computer is being used by other people from my house and i don't want them to access my website when i'm not around, but i also want to have my passwords stored in my browser so that i don't have to look here and there to find them if i forget them (and it happens often :P ).
For now I just managed to totally avoid the autofill (setting to false the variable signon.autofillForms), but i want the email/usernames field suggested to me if i already used them.
You should be able to save your cleartext form fields (emails and the like) without saving passwords. Under Preferences->Privacy->History select Remember History (or Use custom settings for history, then check Remember search and form history), then under Preferences->Security->Passwords uncheck Remember passwords for sites.

Text only Data Validation

I know there was a similar question asked but I couldn't manipulate that code. What I need is Data validation that will make sure the user ONLY enters 2 characters and both of them have to be text. I keep running into trouble because the system allows when I type w1. Any help would be greatly appreciated
Data Validation only 2 characters long and both characters must be text
Don't know whether it is the best way, but try it:
=AND(LEN(A1)=2,LOWER(LEFT(A1,1))>="a",LOWER(LEFT(A1,1))<="z",LOWER(RIGHT(A1,1))>="a",RIGHT(LEFT(A1,1))<="z")

gmail username syntax method for spam prevention

i'm very aware that this is probably not a stackoverflow question, but i figure someone here might know the answer...
a few months back i was sent an image detailing a neat method for spam prevention using a little known feature of gmail..
basically you can use a specific syntax in your email address when you give it out to include some kind of identifier within the email address so you can later distinguish which version of your email address was distributed/crawled to create spam and then, if you want, create filters based on this identifier.
something along the lines of username|identifier#gmail.com which will still beforewarded to username#gmail.com except | is not the correct token and i can't find the doco where i found this information or remember what the correct special character is.
so if anyone knows about the feature i'm describing, i'd love to find out how to get it to work!
thanks, and sorry for the non-programming question.
p.
Use a + sign instead of the |

Retrieve data from the web using Excel [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've spent hours scouring the net for anything to do with VBA calling data from the web in excel and nothing provides a tutorial on how to do so, only complicated examples un-related to what I want to do.
I want to pull data from either a .html or .xml site, doesn't matter, via Excel and find specific points in that data. I can find specific points but don't know how to get the data or scroll through multiple lines. I've done this exact sort of thing in mIRC (sort of C code).
http://eve-central.com/home/quicklook.html?typeid=438
http://api.eve-central.com/api/quicklook?typeid=438
Those are two examples, using roughly the same data I'd like to retrieve. It'd be FAR more specific with at most 100 or so different values.
I'd like to be TAUGHT how to do it, not given the code to do it, or if you must explain each part with comments in-depth please.
Edit: I'm just saying here that I don't want you to link me some random code that does something similar and expect me to modify it without an explanation. Not wanting someone to just write up a full guide of internet capability for Excel.
Thanks
Nick
Edit: I'll try explaining it again in a different sense. I play a game called EVE Online, and there's a lot of "market" databases online that allow access in this form for programs to extract data of certain items' prices. Pretty much I want to do that in an Excel document and then obviously list them in a hidden sheet or something. I don't want to have to use a secondary program, I know it's entirely possible within just Excel.
Have a look here - How can I send an HTTP POST request to a server from Excel using VBA? and getHTTP with (excel) VBA?
That deals with the code part. A note regarding the links provided, refer to the MSDN documentation regarding the WinHttp.WinHttpRequest.5.1 and MSXML2.ServerXMLHTTP to gain better clarity regarding what the these libraries are used for. I also suggested reading up a bit about using COM objects in VBA
I'd like to be TAUGHT how to do it,
not given the code to do it, or if you
must explain each part with comments
in-depth please.
Not to be rude, but this sounds to me like you want someone to teach you how to code. I dont think one can simply teach code.
Edit:
I misunderstood your question, correct me if I wrong, but the crux of your question revolves around I can find specific points but don't know how to get the data or scroll through multiple lines.
Using http://msdn.microsoft.com/en-us/library/aa163921(office.10).aspx, you would probably need to get all your result nodes into an XML object. You could then need to loop through the result set ( which I think is what you meant by scroll).
Related question: How to parse XML using vba
This is a quick and rough answer, becuase what your doing sounds a little bit dodgy(see comment), but from my understanding of Excel, I think your best bet is to use the ODBC driver and connect directly with MS Access (then export into excel) to the same database that the website is using to to receive all the data.
Which will mean that you will need:
1. both the username and password to the database.
2. the associated sql queries that the website is using to retrieve the data. (which may include joins, functions etc.)
Otherwise, you will have to get it through the "front", and you will need to write your own html parser for the section of each page to generate an xml file so that excel can read the final contents table data cleanly. (for excel 2007 and up.)
Doing so will also allow you be able to infer a column's 'data type' such as int, char, bigint etc. in the xml schema. But yeah, this might only need to be done probably in something like console C#/C++/java whatever, not in excel itself because I'm pretty sure excel doesn't have a feature that lets you write your own 'HTML to XML' parser for a website it knows nothing about.
hope this helps..
1) Copy a link to the price data you want. ie
http://api.eve-central.com/api/marketstat?typeid=34&typeid=35&regionlimit=10000002
2) In excel select the location you want the data to be imported to. Preferably a blank sheet.
3) Data -> Import External Data -> New Web Query.
4) Paste the link into the address bar. You can edit the link later on to add or subtract typeids.
5) Press the Go button.
6) Select one of the yellow arrow boxes. I chose the box directly above the line evec_api version.
7) Press the Ok button to import the data to the sheet you selected in step 2.
Now you can right click on the data to "Refresh Data".
Use whatever look up formulas to read the prices from this data to the rest of your sheet.
You can change the address of the Web Query by right clicking on any part of the data and selecting "Edit Query..."
Hope this gets you going in the right direction. This will work with Excel version 2002(XP) and 2003. Excel 2007 is more friendly to XML queries.

Resources