Multiple choice MsgBox - VBA Visual Basic for Applications ...

[Excel] loop issue

Hello all,
I'm stuck with a loop issue, and hopefully someone can help me out a bit.
This code is supposed to checking if the file is opened by another process, for example another user on the workplace.
But I don't get the loop to function properly.
How can I make the code check if the Boolean is false or true for every integer?
Bonus question: The code stops working if I enable the disabled lines (for-loop). If I enable those, this code thinks the excel is always locked.

Can anyone help me with this?
Option Explicit Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) Sub CheckExcel() Dim ExcelName As String ExcelName = "K:\03. Native Drawings\01. Drawing Nos\Test1.xls" If Not IsFileLocked(ExcelName) Then End If End Sub Function IsFileLocked(ExcelName As String) As Boolean On Error Resume Next Open ExcelName For Binary Access Read Write Lock Read Write As #1 Close #1 'Dim i As Integer 'Disabled 'Dim question As Integer 'Disabled 'Start: 'Disabled 'For i = 1 To 5 'Disabled 'If i >= 5 Then GoTo Cancel: 'Disabled If Err.Number <> 0 Then Err.Clear IsFileLocked = True MsgBox "File is locked" End If 'Sleep 250 'Disabled 'Next i 'Disabled 'Cancel: 'Disabled 'If i = 5 Then 'Disabled 'question = MsgBox("Test1.xls is locked", vbRetryCancel, "Error") 'Disabled 'If question = vbRetry Then GoTo Start: 'Disabled 'If question = vbCancel Then 'Disabled 'End If 'Disabled 'End If 'Disabled End Function 
Thanks in advance.
submitted by Chriand to vba [link] [comments]

Download PDF from URL in Excel VBA

Looking to download a PDF from a URL. I can't seem to get past the login screen as the pdf that is downloaded only contains the code for the login page if I open it in NotePad. I examined the post request after logging in manually and pasted it after "FormData." I'm not sure if it matters what I called this variable? In one of the posts I reference below, he used "strAuthenticate."
When I examine the pdf that I want to download in chrome DevTools, it says this:
Does it matter that the the pdf is a plugin rather than an attachment? Also the src is the site as what I have in the fileUrl in the below code.
Sub SaveFileFromURL() Dim FileNum As Long Dim FileData() As Byte Dim WHTTP As Object mainUrl = "" fileUrl = "" filePath = "C:\myfile.pdf" myuser = "xxxxxx" mypass = "xxxxxx" j_security_check = "j_username=" & myuser & "j_password=" & mypass Set WHTTP = CreateObject("WinHTTP.WinHTTPrequest.5.1") WHTTP.Open "POST", mainUrl, False 'WHTTP.Open "POST", fileUrl, False WHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" WHTTP.send j_security_check WHTTP.Open "GET", fileUrl, False WHTTP.send Debug.Print WHTTP.getAllResponseHeaders() FileData = WHTTP.responseBody Set WHTTP = Nothing FileNum = FreeFile Open filePath For Binary Access Write As #FileNum Put #FileNum, 1, FileData Close #FileNum MsgBox "File has been saved!", vbInformation, "Success" End Sub 
Links that I have referenced or looked at:
VBA WinHTTP to download file from password proteced https website
How to make a POST request to a page that may redirect to a login page
Any help is appreciated!
submitted by GlBBLES to vba [link] [comments]

How to customize your Chill behavior

How to customize your Chill behavior
Wall of text and tables inc. TL;DR almost at the bottom.
When AMD implemented Chill into their drivers in December 2016 up until driver 17.12.1 (Adrenaline 2018) these registry entries were exposed to the user and could be changed to the users preferences.
With the big 2017 driver they expanded the Chill support to all games (if your driver weren't bugged) and it would have been nice to have the ability to control Chill within the GUI from the start.
And with either 17.12.1 or 18.2.2 they deleted all these registry entries (I don't remember testing at the time because I thought the removal of these meant they don't work anymore).
I found these values some weeks after the initial release of Chill and didn't bother to release them publicly because I play too much blizzard games and as you might know, whenever someone comes up with cool stuff there is a 95% chance of them shutting it down or fix/prevent it from happening. I know the actual devs of Chill and Boost are active in this subreddit and the chance of them seeing this and pulling a blizzard are there but I think the benefits for people is big enough. The worst that can happen is that they block these entries in new drivers which nobody used anyway. /shrug
All these entries act as overrides so deleting them !!SHOULD!! restore default behavior. If not, you may need to reinstall your drivers (dirty, amd cleanup or ddu).
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\AMD\Chill] "ChillLevelDefault"=dword:00000002 "LoadingScreenDrawsThreshDefault_DXC"=dword:000000c8 "LoadingScreenDrawsThreshDefault_DXX"=dword:00000096 "LoadingScreenDrawsThreshDefault_MTL"=dword:000000c8 "LoadingScreenDrawsThreshDefault_OGL"=dword:00000064 "LoadingScreenDrawsThreshDefault_UDX"=dword:00000064 "LoadingScreenDrawsThreshDefault_VUL"=dword:000000c8 "MaxFramerateDefault"=dword:0000008c "MinFramerateDefault"=dword:00000046 "MaxFramerateRange"=dword:0000012c "MinFramerateRange"=dword:00000014 "ProfileEnableDefault"=dword:00000000 "ToggleKey"=dword:0000007a "CONTR_LOOK_EVENT_ALPHA"="16" "CONTR_WALK_EVENT_ALPHA"="32" "DIR_CHANGE_EVENT_ALPHA"="16" "DIR_CHANGE_HOLD_TIME_DIV"="125" "FAST_MOUSE_MOTION"="20" "IDLE_FRAMERATE"="30" "KEY_HELD_EVENT_ALPHA"="32" "KEY_HELD_SLEEP_COEFF"="128" "KEY_PRESSED_EVENT_ALPHA"="8" "LOADINGS_CREEN_DRAWS_THRESH"="150" "MOTION_START_TIMEOUT_DIVIDER"="20" "MOUSE_SPEED_ESTIMATION_OPT"="0" "NUM_DIR_CHANGE_HOLD_FRAMES"="0" "NUM_MOUSE_SPEED_SAMPLES"="16" "SPEED_TAIL_EVENT_ALPHA"="16" "GlobalEnable"=dword:00000000 
Before you enable these settings I would suggest reading at least the first part (some entries are probably deprecated or overwrite keybinds).
You can save this as a .reg file and customize it before running or adding it to your registry manually.
Toggling Chill off and on applies these values (need to wait for the three ticks or it's not fully off), no need to restart anything.
I will go into a slight overview of every entry to the best of my knowledge (and testing).
"LoadingScreenDrawsThreshDefault_DXC"=dword:000000c8 "LoadingScreenDrawsThreshDefault_DXX"=dword:00000096 "LoadingScreenDrawsThreshDefault_MTL"=dword:000000c8 "LoadingScreenDrawsThreshDefault_OGL"=dword:00000064 "LoadingScreenDrawsThreshDefault_UDX"=dword:00000064 "LoadingScreenDrawsThreshDefault_VUL"=dword:000000c8 "LOADINGS_CREEN_DRAWS_THRESH"="150" 
I guess these are the FPS up to which Chill will engage over ChillMax. ChillMax + THRESH, anything above will disable Chill.
So with ChillMax = 300 and Thresh = 150, Chill would limit your FPS to 300 until your theoretical frametimes exceed the frametimes of (1 / (ChillMax + Thresh)) or 450FPS.
I had loading screens with 4 digit FPS with Chill on, maybe you can test it if you need something like this.
Not working for me anymore, don't change values in the overlay or ingame. They used to work with pre 18.12.2 (Adrenaline 2019) to decrease the ChillMin to 1 FPS.
Minimum FPS got replaced by
Set the default lower Chill limit.
MaxFramerateRange got replaced by
Same as "MaxFramerateDefault".
"ChillLevelDefault"=dword:00000002 "GlobalEnable"=dword:00000000 "ToggleKey"=dword:0000007a "ProfileEnableDefault"=dword:00000000 
I deleted them just as a precation if they might be incompatible with Adrenaline 2020.
Don't seem to change anything relevant or tested. Hard to test mouse movement events though.
ALPHA = Amount of frames to be displayed after certain action; 0 is disabled, max is at least 512 but probably more
"KEY_PRESSED_EVENT_ALPHA" Duration in "seconds,milliseconds"
64 1,375 (Stopwatch and then rounded)
96 1,912 (Interpolated)
128 2,75 (Stopwatch and then rounded)
160 3,437 (Interpolated)
192 4,125 (Interpolated)
224 4,812 (Interpolated)
240 5,156 (Interpolated)
256 5,5 (Stopwatch and then rounded)
384 8,25 (Stopwatch and then rounded)
512 11 (Stopwatch and then rounded)

\"KEY_PRESSED_EVENT_ALPHA\"=\"256\" Range 30-130FPS

\"KEY_PRESSED_EVENT_ALPHA\"=\"512\" Range 30-130FPS

This data was captured with the build in logging tool set to 0,25s interval.
X-axis represents these intervals and the Y-axis the FPS.
Results tested with "KEY_HELD_SLEEP_COEFF"="0" so I get the maximum framerate in an instant.
Duration in ms = Alpha * Average frametime of ChillMaxFrameTime and ChillMinFrameTime.
ChillDuration := Alpha * (((1 / ChillMin) + (1 / ChillMax)) / 2)
10,50s := 512 * (((1 / 30) + (1 / 130)) / 2)
Close enough to 11s with manual time measurement.
For anyone interested I wrote an AutoHotKey script which can better explain what I am thinking about:
; Ctrl + 1 to get the results ^1:: ChillMin := 30 ChillMax := 130 ChillMinFT := 1 / ChillMin ChillMaxFT := 1 / ChillMax ChillAvgFT := (ChillMinFT + ChillMaxFT) / 2 ChillDiffFT := ChillMinFT - ChillMaxFT Coeff := 1 ; that probably has to go somewhere Alpha := 8 SetChillFT := ChillMaxFT + (ChillDiffFT * (1 / Alpha)) SetChillFR := 1 / SetChillFT ChillAvgFR := 1 / ChillAvgFT ChillDuration := Alpha * ChillAvgFT msgbox, SetChillFT: %SetChillFT% SetChillFR: %SetChillFR% `nChillAvgFT: %ChillAvgFT% ChillAvgFR: %ChillAvgFR%`nChillDuration: %ChillDuration% return 
I don't know if it is accurate for other Chill values and are just too many to test.
But that is just the duration, the way the FPS get lowered is not affected by it (besides obviously declining faster).
I guess it is inversly proportional because the Alpha is used as a divisor.
Frames to buffer after input with I would assume right analog stick. (Default for looking around in games)
Same for left analog stick. (Default for walking around in games)
The last time I used Chill with a game I played with a controller the shoulder buttons and triggers would not increase the FPS maybe because they are considered as Xinput commands and need to be coded explicitly like the analog sticks.
Key_Alpha is only triggered by keyboard, mousebutton 4, 5 and wheelclick input in my testings.
Probably listening to scancodes or something because it has the same 2 keys to disable it temporarily (RShift and RCtrl) like boost (only RShift) has.
Holding a key will increase the buffer set by "KEY_PRESSED_EVENT_ALPHA" previously.
"KEY_PRESSED_EVENT_ALPHA"="512" with "KEY_HELD_EVENT_ALPHA"="0" would spike to ChillMax but is affected by "KEY_HELD_SLEEP_COEFF"="128" so you can adjust how high it will peak.
0 129,6
8 117,4
16 107,3
24 98,8
32 91,5
40 85,3
48 79,8
56 75,0
64 70,8
72 67,0
80 63,6
88 60,5
96 57,7
104 55,1
112 52,8
120 50,7
128 48,7
136 46,9
144 45,2
152 43,6
160 42,1
168 40,7
176 39,5
184 38,3
192 37,1
200 36,0
208 35,0
216 34,1
224 33,2
232 32,2
240 31,5
248 30,7
256 30,0

First test with a range of 30-130FPSfor a 100FPS range. These are the continuous FPS while holding any key input.
The X-axis shows the row of the table and not the value of "KEY_HELD_SLEEP_COEFF" because office software (i HATE office software with a passion and thats the best i could do without smashing my monitor)
The Y-axis shows the FPS. Same for the diagram below.
0 80,0
32 66,1
64 56,4
70 54,9 (Middle of Chill range)
96 49,2
128 43,6
160 39,1
192 35,5
224 32,5
256 30,0

Second test I did with a range of 30-80 for a 50 FPS range.
Holding any key will get you the FPS you can see in the table above in their respective ranges.
I don't know the function of the numbers but they look like the same as for the Alpha but reversed and not as steep.
Numbers of frames before "DIR_CHANGE_EVENT_ALPHA" kicks in and independent from said option.
With a low Alpha it holds the FPS at max settings and then drops at the rate of the alpha.
"NUM_DIR_CHANGE_HOLD_FRAMES" / FPS = Seconds of frames hold
Left, right, top, bottom and from my testing even from no movement to one side. Basically any movement expect constantly in one direction.
Hard to test even with a AutoHotKey script that simulates consistent mouse movement. My take would be:
How many pixel to move per frame before adding one to "SPEED_TAIL_EVENT_ALPHA".
Lowering the number will make it easier to reach ChillMax because with "FAST_MOUSE_MOTION"="20" it triggers at 1px mouse movements.
In addition to all of that, they ALL add up, so holding a key and then pressing another while holding down the first key will get you the FPS increase from "KEY_PRESSED_EVENT_ALPHA" as well as any other option.

"CONTR_LOOK_EVENT_ALPHA" 1-x higher value = longer higher FPS from pressing controller inputs
"CONTR_WALK_EVENT_ALPHA" 1-x higher value = longer higher FPS from holding controller inputs
"KEY_PRESSED_EVENT_ALPHA" 1-x, higher value = longer higher FPS from pressing keyboard inputs
"KEY_HELD_EVENT_ALPHA" 1-x, higher value = longer higher FPS from holding keyboard inputs
"KEY_HELD_SLEEP_COEFF" 0-255, lower value = higher continuous FPS from holding keyboard inputs
"NUM_DIR_CHANGE_HOLD_FRAMES" 1-x higher value = longer higher FPS from mouse movement changes without dropping
"DIR_CHANGE_EVENT_ALPHA" 1-x higher value = longer higher FPS from mouse movement changes
"FAST_MOUSE_MOTION" 0-x lower value = higher FPS from any mouse movement
"SPEED_TAIL_EVENT_ALPHA" 1-x higher value = longer higher FPS from straight mouse movement
I can't give any specific tips for your personal config, but I would go like this:

"KEY_HELD_SLEEP_COEFF" to about 0-16 as it gets 100% to 75% of ChillMax.
"KEY_PRESSED_EVENT_ALPHA" to 2x to 4x your ChillMax for games with lots of keyboard input.
"FAST_MOUSE_MOTION" to 0-5 for games with lots of mouse input.
Any mouse related Alpha to 2x to 4x your ChillMax for games with lots of mouse input.
"KEY_HELD_SLEEP_COEFF"="0" and "KEY_HELD_EVENT_ALPHA"="1x ChillMax" for both performance and efficiency.

Sadly these settings are global but as a workaround you can customize it and save them as .reg files as presets for different games.
Template with only relevant entries(and my current settings):
A little sidenote to the VSR users out there:
Another deleted registry entry which still works with 19.12.3.
It was an DWORD until its removal and if you knew and tried it as DWORD it woudn't work because it only accepts a binary value.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000] "DALNonStandardModesBCD1"=hex:28,80,16,20,00,00,00,00 
You can add multiple Virtual Super Resolutions like this:
Bytes 1-4 are X resolution, 5-8 are Y resolution 9-12 are unused and 13-16 WERE Hertz (00,60 was 60Hz and 01,44 was 144Hz) and are post 18.2.2 also unused. 16 Bytes per resolution but only the first 8 are used and the rest needs to be filled before adding another one.
It will make only the highest Hertz possible availabe so just leave them empty (AMD revamped VSR with 18.2.2 to work with other ratios than 16:9 and changed this part).
It still limits you to 2x the resolution per axis of your display. 1080p monitor = 2160p max, 1440p monitor = 2880p max, etc.
Save as .reg and edit as you want and then run it (or manually create the entry yourself (Binary value)). Resolutions are available after a restart.
submitted by Gyonas to Amd [link] [comments]

Let's talk about SciTE4AutoHotkey, what Groggy is up to, why he's currently groggy and why that's the reason for the update. Here's a thread for info, comments, and suggestions. (PS - Happy Friday, everyone!)

Hey guys. I'm pretty excited about getting to post this. Warning: Wall of text incoming. This is like an account of all the stuff that's happened. Don't worry, to prevent total boredom, I've added pictures and gifs. Like a picture book.
Anyway, I've had this big bout of insomnia lately. Like 1-3 hours of sleep a day. Less than 20 hours in a week. It SUCKS!
Maybe it's because my my laptop is inoperable due to fan failure. I had to order a new one because the original died and we all know shipping time is brutal from China.
I'm mentioning that so I can mention this. Me getting 1-3 hours of sleep a night = Hella free time. Hella free time + my main machine being down = X Solve for X. X = I needed a project.
Of my options on "Things to do", SciTE4AutoHotkey was something that had been on there a while, piqued my interest, was something I could start from scratch, could be done on a sub-par laptop, and it seemed beneficial to not just me but everyone. So, I picked it up like a pair of scissors and ran with it.
Some of you may have seen my comment the other day. Twas not a bluff or an attempt at getting free uppies. A couple days before that post, I had already started (and have been actively) rewriting the entire ahk.api and files from scratch.
I'm also worried about the fact that it has been like 1/2 a decade since someone has updated these files.
I finished rewriting and "carding" every command, built-in function, and built-in variable a couple nights ago. Since then I've (mostly?) finished getting all the "other keywords" listed (What a pain in the ass. Even at this point I know I've missed some stuff. There are just so many options, subcommands, sub-subcommands, properties, methods, guys are smart. You get what the hell I'm going on about.) Last night I started getting into the guts of the program, commenting out the AHK files, reading up on .api files, reading about SciTE's options, etc... More SciTE info for those interested.
So, what changes have you made to the API?
The following numbers are rough but accurate. Items refers to commands, built-in variables, built-in functions, flow controls statements, and other keywords. "Other keywords" refers to language verbs, options, subcommands, subcommand options, etc... Example:
and not in is between extends this on off alwayson alwaysoff toggle ... 
Registry words/values, sound options, sysget/winget/process options, etc... are all "other keywords":
You get the idea.
The Old API has about 1093 items. Of those 1093 items, only 123 have any type of additional info bundled with them. 970 are cardless/infoless. The ones that do have info provided have only the most basic of information and options with no info about anything else.
At the time of this posting, the new API I've written has 1383 items. Up 290 items from the old API. (I can guarantee this will go up before beta release.) Of those 1383 lines, 738 of those items (almost every single command, built-in function, variable, and flow control statement) has a card. Up 615 from the old API's basic info. Of the 645 of those items that don't have cards, most lack one, because they're either "other keywords" or are options|subcommands that are covered on a main command's/function's card.
Why even bother adding all those extra words to the API? It seems like a lot of crappy work for no payoff.
A few reasons.
  1. It causes those commands to show up in the word list.
  2. It makes typing things easier to type. Example: Typing REG_ shows all the Registry stuff in the word list. Pick the one you want and hit enter.
  3. Having all the different keywords listed allows them to receive syntax highlighting. This can be used like a form of visual validation while coding.
A little more info on the updated API (because everyone loves tables!):
Count New Old Increase
CHARACTERS 119,338 28,930 x4
WORDS 17,451 3,533 x5
PARAGRAPHS 1,383 1,093 x1.3
WHITESPACE* 19,123 2,485 x8
* Lots of padding from formatting and cheat sheets.
What exactly are these "CARD" things?
Cards are what I'm calling extended tooltips. For example, with the old SciTE4AHK, if you type #KeyHistory you'd see this. With the new version, you'd see this. (That's one of the lesser detailed cards).
Why bother making cards?
Well, I get sick and tired of wasting time alt+tabbing back and forth from SciTE to the docs just to get small pieces of info. It seems like this wastes a lot of time.
Does this function return a 1 or a 0? Or an empty string? Does it return a word? If yes, what word? What does that word mean? What's the subcommand for this command? Does the subcommand have different syntax?? What are that subcommand's options? What's the option for removing duplicates when using the sort command? What about that option that lets you sort by numbers even if they're inside of a string? Does this command's field use traditional or expression format? Does this command set an errorlevel? Have you the Format() command?!
Do you see what I mean? Time wasted because we need some tiny bit of NECESSARY info to make everything work.
I thought "Why the hell not just update the tooltips to have all the info right there?" Why not make SciTE4AHK better by making its calltips more robust and more like a quick reference guide?"
It sounded good to me so...I did it.
How do these cards look?
Currently, each card is set with its full syntax (multiple lines if the command warrants it) followed by its use and whatever extra info goes with it. I've tried to keep these cards small and compact but still pack in as much info as possible. Commands with multiple subcommands have all subcommands listed at the bottom and each subcommand should have its own card with its own options. The goal is not to cover the entire documentation of each command on each card, but to streamline the important info, the options, get return/errorlevel info, etc.
To the newer users out there, you should always read a command's/function's documentation before using it. Don't go off just the card/calltip. Some commands have tons of info that I could never fit onto 1 card. You might miss an option you need or you might misunderstand a command's usage/output/etc... Though I don't think this will be likely because the cards are pretty straight forward.
Here's the general layout/legend for the current card setup. This lists the majority of LABELS: I use with the cards. No one card will ever have all these.
Command, Value|Subcommand, [OptionalParams, Select|One|Option] NOTES: Item refers to any command, built-in function/variable, or keyword. Parameters separated by | pipes indicate "select one of these". Items inside [] brackets are considered optional. TAGS: USE: What a command/function is used for. VALUE: Variable/text/number. Used as input/output for commands. SUBCOMMAND: List of subcommands for the current command. Most subcommands have their own card and own options. DEPRECATED: A command is phased out and should no longer be used. Deprecated tags always come with a replacement tag. REPLACEMENT: Replacement commands/functions for deprecated items. REPLACEMENT: Use SubStr() instead. REMARK: Additional or beneficial information about an item. REMARK: Omitting WinTitle will default to LastFoundWindow. RETURN: The values a function can return and what they mean. RETURN: 1 = Key Down. 0 = Key Up. ERRORLEVEL: Possible ErrorLevel values and what they mean. ERRORLEVEL: 0 = Failure. 1 = Success. EX: Example of command/function use. Most items have these. Also shows return values and/or how the new data looks. R = Return value of command/function => vaobj after of command/function runs EX: arr =: [1, 2, 3] Arr.RemoveAt(2) ; R=2 ; arr => [1, 3] CHEAT: This item has additional data or info on a Cheat_Sheet_ card. These are used for reference charts, data tables, or other info that just can't fit onto 1 card and tend to be larger than normal. 
About cheat sheets: This is a new category I've added. It's a bunch of cards that have the prefix Cheat_Sheet_ and can be called just like any other command or function. Type "cheat", select the one you want from the word list, hit enter to make the text appear (unfortunately, this is necessary) and then hit space. Like I mentioned before, have you seen the Format() function!? That thing is getting its own cheat sheet.
Examples: Cheat_Sheet_HTML_Color_Names Cheat_Sheet_RegEx
Deleting the word makes the tooltip go away. Ctrl+Backspace deletes a whole word instead of just 1 character. It makes things easy. Or just hit esc.
If you're close to being done with the API (and subsequently the keywords file), what do you have left?
I still have quite a bit left.
Re-organize some of the content Homogenize card formatting (make sure every card follows the format that I've changed like 8 billion times since starting) Proofread EVERYTHING again to find errors, typos, etc... Quite a few cheat sheets to create/finish/prettify. Find a clean way to incorporate hotkey card changing/scrolling. Wanting to use mousewheel up/down and arrow up/down (or possibly ctrl+up/down for this). Get TillaGoTo to recognize functions correctly. Change the opening/closing behavior of calltips/cards and find a way to ensure that the wordlist comes up when it's supposed to. Add a new syntax category that acknowledges AHK's built-in properties and methods. Example: File object methods, file object properties, default object methods, exception object properties, etc.. I'm considering making a "lite" version of the API for those who want minimalistic calltips. 1-3 lines per card? Let me know if there's a want for this. Add a light/dark mode for the wordlist, calltips, and tillagoto. See if there's a possibility to add color support for wordlists/calltips in the themes/option. Looking at bundling Maestrith's GUI Creator with this instead of Smart GUI Creator. I feel Maestrith's GUI Creator is a much better GUI Creator. Or, should I leave Smart GUI Creator in along with it? Opinions? Also, I'm thinking about bundling this impressive message box creator called Magic Box to replace the older MsgBox Creator.
It's a long list but I'm trying to knock stuff off it little by little.
Here's hoping to have a working Beta available soon for you guys.
Speaking of releasing a Beta... If you guys notice a typo, error, come up with a word(s) that should be added, or anything else, SPEAK UP AND LET ME KNOW. Worst case scenario: I disagree with you, I don't add it/change anything, and you're not out anything. Best case scenario: I agree, add it, and you+everyone else get the functionality you requested. Same goes with design ideas/suggestions. But, being honest, I don't have plans on doing tons of expansions to this program (I might not even be capable of it). Regardless, feedback is a great thing. Opinions on the name SciTE4AHK_GO? For GroggyOtter Edition.
When the beta is released, I'll be making a new sticky post. If you'd like a tag notification, leave a comment below with "notify me" in it.
I'll post edits if there's anything else worth mentioning/updates to give. Make sure you check back.
Gonna go grab a burrito. <3
Edit: Still actively working on this. I've invested quite a bit of time into it and will probably be investing quite a bit more as the list of things I want to change/add is growing. Also, my fan finally came. Didn't work. Wrong brand. Wrong amperage... The moral of the story is don't order things from China.
Edit 10Oct2018: For those checking back, I'm still going at this full bore. I had to, unfortunately, rewrite my rewritten API. I did a really REALLY dumb thing. During a simple RegEx search/replace during a formatting thing I was doing, I managed to not click the "in selection" box. It wiped out everything after a comma... All the items and their formatting were saved, but a lot of sentences became 1/2 sentences, commands had all parameters wiped, examples were blanked, etc. :( "Why didn't you just ctrl+z?" Because I didn't know about it until way WAY after. "Why didn't you restore a backup?" The last one I had was pre-finish, let alone pre-formatting changes I had started to do. So, yeah, moral of the story is back your shit up (frequently) and don't make formatting changes to a master document...
On a positive note, I've gotten EVERYTHING redone except for commands H-Z (so like 90% of all lexems in the lexer). As a bonus, the rewrite (I don't like saying rewrite. It's more like re-transcribe and re-format...) allowed me to restructure everything and made the whole process go much faster and smoother. It took probably less than 1/2 the time to do it the second time around. :)
I've also added quite a bit to the "things I'd like to change/implement" list. Not going to post it because I don't know what I want to keep and not keep and don't want to get hopes up. But I will mention one thing I came up with that I really liked and want to run with. I came up with this option. No name yet but I'm thinking SynGUIs or SynStrings. Anyway, the current idea is based on a .syn hotstring. It checks the command/function just typed, looks it up, and then loads a small GUI with that command/function and all its parameters preloaded with defaults (maybe add an option to save user preferred command defaults?). The first design was to use all edit boxes but then I decided to use param appropriate controls. If there are only 3 options, add a dropdown with the 3 options. If there are multiple options, add some checkboxes. Tab navigation. Escape to close. Enter (or click OK button) to insert command where it just was. AKA mouseless navigation. Also, I'd like to implement some kind of error checking. I'm hoping something like this will result in faster code creation with fewer errors. I've already started working on this as a "take a break from writing and formatting the API".
So, that's the update. I hope to have a working beta for you guys sooner than later. Just know that I'm actively working on this every day during my free time. :)
Edit 18Oct2018: I've pretty much written an entire AHK v1.1 Lexicon from the online docs. From that I've made an updated/revised ahk.api rewrite. Admittedly, I think the calltips are a bit large and I need to consider trimming them down or possibly just making a "lite" version with more minimalisitic calltips. I've created some more Cheat_Sheets. Yay! I'm currently working on updating the syntax file with the new categories I've made. This will expand what gets highlighted and allows for more color options.
I've started updating TillaGoto. All the regexs for labels, hotstrings, and functions have been rewritten. Yes functions now show up! Overhauling the GUI and adding some new features. A new sort feature has been added to sort the results in the lsit box by 1) The order it was found 2) ascending order or 3) descending order. Can be seen in the screenshot below. The original colors were really bright, especially against my happy hacker theme. Screenshot of original TillaGoto. I decided to add a "dark mode". Updated TillaGoto in dark mode with the same file. Dark mode can be accessed from the new system tray icon. If anyone wants to design a neat new icon, feel free to post them. I'll let you know if I want to use it. I want to add classes to the detection list and possibly class method detection. I also want to add a tab system that will allow users to sort results by specific type. So there would be an All tab, a Function tab, a Label tab, etc...
That's not everything, but it's a good chunk. With the lexicon rewrite (which I will be posting, too) and api being done, I'll be able to really focus on the changes and updates I wanted to make.
submitted by GroggyOtter to AutoHotkey [link] [comments]

VBA to Download File, Put in USERNAME and PASSWORD and Save to Current Folder

I am attempting to go to a website, put in my username and password (variable "User" and "Password" which are set to be equal to a certain range) and save the file that will be spit out from the link to the same folder as the excel file running this macro.
I get the following error:
Run-time error '5':
Invalid procedure call or argument
On this line (ln 69) xmlHTTP.Open "GET", strFile
Code itself:
 Public Sub Direct_Download_via_HTML() 'make sure you add references to Microsoft Internet Controls (shdocvw.dll) and 'Microsoft HTML object Library. 'Code will NOT run otherwise. Dim fileStream As ADODB.Stream 'the stream to download the file over Dim xmlHTTP As MSXML2.xmlHTTP 'out connection to the http output Dim strURL As String Dim strFile As String Dim ie As InternetExplorer, ieDoc As HTMLDocument Dim objIE As SHDocVw.InternetExplorer 'microsoft internet controls (shdocvw.dll) Dim htmldoc As MSHTML.HTMLDocument 'Microsoft HTML Object Library Dim dropOptions As MSHTML.HTMLDocument 'Microsoft HTML Object Library Dim htmlInput As MSHTML.HTMLInputElement Dim htmlInput2 As MSHTML.HTMLInputElement Dim htmlColl As MSHTML.IHTMLElementCollection Dim Post As Object, elem As Object Dim User As Range Dim Password As Range Set objIE = New SHDocVw.InternetExplorer Set User = ActiveSheet.Range("A1") Set Password = ActiveSheet.Range("A2") Set xmlHTTP = New MSXML2.XMLHTTP60 With objIE 'Open Login Page .navigate "[website here]" ' Main page .Visible = 1 Do While .readyState <> 4: DoEvents: Loop Application.Wait (Now + TimeValue("0:00:05")) 'Set user name and password Set htmldoc = .document Set htmlColl = htmldoc.getElementsByTagName("INPUT") Do While htmldoc.readyState <> "complete": DoEvents: Loop For Each htmlInput In htmlColl If htmlInput.Name = "userid" Then htmlInput.Value = User Else If htmlInput.Name = "password" Then htmlInput.Value = Password End If End If Next htmlInput 'Click login Set htmldoc = .document Set htmlColl = htmldoc.getElementsByTagName("input") Do While htmldoc.readyState <> "complete": DoEvents: Loop For Each htmlInput In htmlColl If Trim(htmlInput.Type) = "submit" Then htmlInput.Click Exit For End If Next htmlInput 'now get the file using ADODB Set xmlHTTP = New MSXML2.xmlHTTP xmlHTTP.Open "GET", strFile xmlHTTP.send If xmlHTTP.Status <> 200 Then MsgBox "File not found" GoTo exitsub End If 'now write the responseBody to a file as a csv, using an ADODB stream Set fileStream = New ADODB.Stream With fileStream .Open .Type = adTypeBinary .write xmlHTTP.responseBody .Position = 0 .SaveToFile ThisWorkbook.Path & "\" & Format(Now(), "yyyymmdd hhmmss") & ".csv" .Close End With 'done exitsub: 'very cursory error trapping in this, you should probably look after that. If Err Then MsgBox "Error occurred " & vbCrLf & vbCrLf & Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly End If 'Tidy up ie.Quit Set ieDoc = Nothing Set ie = Nothing Set fileStream = Nothing Set xmlHTTP = Nothing Set objIE = Nothing End With End Sub 
Something to keep in mind - I have almost zero knowledge of programming and have set up this code as an amalgamation of other people's work. A lot of googling, a lot of trial and error. Actually saving the file is the only set back I'm facing to automating things insofar as to be able to pull the data, import it to the file that analyzes it and spill out the results in a message over Outlook.
Do you have any idea how I can fix this code so that it does what it's supposed to?
I can explain most of the code but some things, like the use of ADODB (whatever that is) and stream are beyond me.
submitted by Urouboros to vba [link] [comments]

Autodesk Inventor macro to export model to Cura, S3D or Slic3r

I like how Fusion360 makes it so easy to export your model to your slicing program, so I made this to simplify things a little in Inventor.
At the top of the macro there are some comments about where to adjust your folder paths if they differ. You can also delete any of the top three Public functions for any program you don't use. There are also options further down for hard-coding the STL resolution and changing the units (mm/inches).
Go to Tools -> VBA Editor and paste into Default.ivb
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) ' Edit paths below if your installation locations differ. ' ' You can delete functions for programs you don't use and they won't ' appear in the list of choices. ' ' STL files are saved to c:\temp - change the location if you wish Public Sub Simplify3D() Call ExportToSlicer("C:\Program Files\Simplify3D\Simplify3D.exe") End Sub Public Sub Slic3r() ' If you want to use Slic3rPE as configured for the MK3, uncomment the ' next 'Call' line and comment out the one below it. If you want it configured ' for a different Prusa printer just check the program shortcut for the ' proper command line arguments and edit below -- it should be similar ' to the 'settings MK3 214' at the end of the line below. ' Call ExportToSlicer(Chr(34) & "C:\Program Files\Prusa3D\Slic3rPE\slic3r.exe" & Chr(34) & " --DataDir " & Chr(34) & "C:\Users\Public\Documents\Prusa3D\Slic3r settings MK3 214" & Chr(34)) Call ExportToSlicer("C:\Program Files\Prusa3D\Slic3rPE\slic3r.exe") End Sub Public Sub Cura() Call ExportToSlicer("C:\Program Files\Ultimaker Cura 3.2\Cura.exe") End Sub Private Sub ExportToSlicer(slicerPath As String) Dim stlPath As String stlPath = "C:\temp\" Dim StlFileName As String ' Get the STL translator Add-In. Dim oSTLTranslator As TranslatorAddIn Set oSTLTranslator = ThisApplication.ApplicationAddIns.ItemById("{533E9A98-FC3B-11D4-8E7E-0010B541CD80}") If oSTLTranslator Is Nothing Then MsgBox "Could not access STL translator." Exit Sub End If Dim oDoc As PartDocument Set oDoc = ThisApplication.ActiveDocument If oDoc Is Nothing Then MsgBox "No open part found" Exit Sub End If If Len(oDoc.FullFileName) = 0 Then Debug.Print "oDoc.FullFileName is blank" MsgBox "Please save file, then rerun" Exit Sub End If Dim Extension As String StlFileName = oDoc.DisplayName Extension = Mid(StlFileName, InStrRev(StlFileName, ".")) StlFileName = Replace(StlFileName, Extension, ".stl") Dim oContext As TranslationContext Set oContext = ThisApplication.TransientObjects.CreateTranslationContext Dim oOptions As NameValueMap Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap If oSTLTranslator.HasSaveCopyAsOptions(oDoc, oContext, oOptions) Then Dim resolution As String ' If you don't want to choose your STL resolution every time comment out this ' line and uncomment the one below it. Resolution values are as follows: ' 2 = Low, 1 = Medium, 0 = High resolution = InputBox("0 = High" & Chr(13) & "1 = Medium" & Chr(13) & "2 = Low", "STL File Resolution", 1) ' resolution = 1 oOptions.Value("Resolution") = CInt(resolution) ' Set output file type: ' 0 - binary, 1 - ASCII oOptions.Value("OutputFileType") = 0 ' Units ' 5 = Millimeter, 4 = inches oOptions.Value("ExportUnits") = 5 oContext.Type = kFileBrowseIOMechanism Dim oData As DataMedium Set oData = ThisApplication.TransientObjects.CreateDataMedium oData.FileName = stlPath & StlFileName Call oSTLTranslator.SaveCopyAs(oDoc, oContext, oOptions, oData) Sleep (1000) Call Open_Slicer(slicerPath, Chr(&H22) & oData.FileName & Chr(&H22)) Else MsgBox "File doesn't have 'save copy as' option" Exit Sub End If End Sub Private Sub Open_Slicer(s3dPath As String, stlPath As String) Dim sFullPathToExecutable As String sFullPathToExecutable = s3dPath & Chr(&H20) & stlPath Shell sFullPathToExecutable End Sub 
submitted by ieatacid to 3Dprinting [link] [comments]

Trying to download file using VBA through Excel, but authentication seems to be failing?

Hey everyone,
I've been trying to speed up my workflow as much as possible, and one of the best ways would be to import data automatically using a macro without having to go through the hassle of downloading from our api and all that stuff.
However I've been trying to use code from various stack overflow and reddit threads and cannot make it work at all. Any ideas? My current code is this (copied from here courtesy of innsyflares):
Option Explicit
Sub foo() 'add a reference to Microsoft XML v6 and MS ActiveX Data Objects 'via Tools/References 'This assumes the workbook is saved already, and that you want the file in the same folder Dim fileStream As ADODB.Stream Dim xmlHTTP As MSXML2.xmlHTTP Dim strURL As String Dim sFilename As String sFilename = Environ("SystemDrive") & Environ("HomePath") & _ Application.PathSeparator & "Desktop" & Application.PathSeparator & _ "file.csv" strURL = "company api url" Set xmlHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0") xmlHTTP.Open "GET", strURL, False, "email", "password" xmlHTTP.send If xmlHTTP.Status <> 200 Then MsgBox "File not found" GoTo exitsub End If Set fileStream = New ADODB.Stream With fileStream .Open .Type = adTypeBinary .Write xmlHTTP.responseBody .Position = 0 .SaveToFile sFilename, 2 .Close End With exitsub: Set fileStream = Nothing Set xmlHTTP = Nothing End Sub 
This executes perfectly as far as calling the api and saving the file, however the file output is a bunch of html code that looks like the page data, which tells me I'm not getting authenticated properly? Any ideas? I know my company uses a SSO authentication for our API's and website, maybe I'm not using the right stuff to authenticate with that?
submitted by Heelincal to vba [link] [comments]

VBA Error Requesting Header

I'm getting an error requesting the header.
Error: Run-time error '2147012746 (80072f76)':
The requested header was not found
Debugging it refers to:
PDFdownloadURL = .getResponseHeader("Location")
Public Sub Download_PDF()
Dim baseURL As String, searchResultsURL As String, pdfURL As String, PDFdownloadURL As String Dim httpReq As Object Dim HTMLdoc As Object Dim PDFlink As Object Dim cookie As String Dim downloadFolder As String, localFile As String Dim fileNum As Integer, fileBytes() As Byte 'Folder in which the downloaded file will be saved downloadFolder = ThisWorkbook.Path If Right(downloadFolder, 1) <> "\" Then downloadFolder = downloadFolder & "\" baseURL = "" searchResultsURL = baseURL & "GetRecDataDetail.aspx?rec=19930074944&suf=&bdt=1/1/1947&edt=11/18/2016&nm=&doc1=&doc2=&doc3=&doc4=&doc5=" Set httpReq = CreateObject("WinHttp.WinHttpRequest.5.1") With httpReq 'Send GET to request search results page .Open "GET", searchResultsURL, False .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0" .Send cookie = .getResponseHeader("Set-Cookie") 'Put response in HTMLDocument for parsing Set HTMLdoc = CreateObject("HTMLfile") HTMLdoc.body.innerHTML = .responseText 'Get PDF URL from pages link '< a id="ctl00_ContentPlaceHolder1_lnkPages" title="Click to view unofficial document" ' href="?binomo=12196" target="_blank">11< /a> Set PDFlink = HTMLdoc.getElementById("ctl00_ContentPlaceHolder1_lnkPages") pdfURL = Replace(PDFlink.href, "about:", baseURL) 'Send GET request to the PDF URL with automatic http redirects disabled. This returns a http 302 status (Found) with the Location header containing the URL of the PDF file .Open "GET", pdfURL, False .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0" .setRequestHeader "Referer", searchResultsURL .setRequestHeader "Set-Cookie", cookie .Option(WinHttpRequestOption_EnableRedirects) = False .Send PDFdownloadURL = .getResponseHeader("Location") 'Send GET to request the PDF file download .Open "GET", PDFdownloadURL, False .setRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/46.0" .setRequestHeader "Referer", pdfURL .Send 'Save response bytes in the local file If .Status = 200 Then localFile = downloadFolder & Mid(PDFdownloadURL, InStrRev(PDFdownloadURL, "/") + 1) If Dir(localFile) <> "" Then Kill localFile fileBytes = .responseBody fileNum = FreeFile Open localFile For Binary Access Write As #fileNum Put #fileNum, 1, fileBytes Close #fileNum MsgBox "Downloaded " & localFile Else MsgBox "Download failed " & .statusText End If End With 
End Sub
Link to Webpage:
Any help would be greatly appreciated. I'm a bit over my head. Thanks!
submitted by TheSkyscraper to excel [link] [comments]

Free Binary Option Strategy Best Binary Options Strategy ... Binary Options Part 2 in Tamil - YouTube $5,000 IN 2 DAYS WITH BINARY OPTIONS - FULL TUTORIAL - YouTube 2 Minutes Strategy Configuring SETTINGS And Indicators ... (9) CAP3 PRACTICA 4 MSGBOX E INPUT BOX.flv 2 Minutes Strategy Binary Options 2020 (IQ Options) - YouTube BINARY OPTIONS TRADING  2+/2- means loss? - YouTube VB6 Multiple Line Message Box Professional Options Trading Course Lesson 1, Part 1 of 2 ... Best Binary Options Strategy 2020 - 2 Min Strategy Live ...

Binary options realbinaryoptionsreview msgbox opzioni risks and there is a chance that clients lose their investments. This website is forum of binary brokers featured herein. Racing trading with any of the brokers, clients should make sure they understand the risks involved. We recommend choosing an EU fare soldi online sondaggi realbinaryoptionsreview for realbinaryoptionsreview residing ... Sub MeldungF() Dim iClick As Integer iClick = 4 Do While iClick = 4 iClick = MsgBox( _ prompt:="Abbrechen oder wiederholen", _ Buttons:=vbRetryCancel) If iClick = vbRetry Then MsgBox "Ich wiederhole!" ElseIf iClick = vbCancel Then MsgBox "Abbrechen" End If Loop End Sub At each step, the binary search algorithm rejects one-half of the items left until it reduces the list to a single item. This is the item we’re searching for. If not, the item is not in the list. To search a list of 1,024 items, the binary search algorithm makes 10 comparisons. At the first step, it rejects 512 elements, then 256, then 128, and so on, until it reaches a single element. For ... Step 2: Here, we will need ... By this, we can perform any type of mathematical process and get the output in an immediate window instead of using MsgBox which is also easy but not as good as Debug Print. Pros of Excel VBA Debug Print. It is easy to apply. No need to change the window to see the output. That we easily can see in the immediate window. We can even delete the output data from an ... x64\MsgBox-x64.log - Information about compilation (generated by MsgBox-x64.au3) x86\ - 32 bit templates MsgBox-1.au3 - Loads and executes fasm code from binary string MsgBox-2.au3 - Loads and executes fasm code from binary file This is the x64 and x86 source files. MsgBox-x64.asm: 2.1 Die MsgBox-Funktion. 2.1.1 Generelle Syntax: 2.1.2 Parameter; 2.1.3 Rückgabewert; Wichtige Objekte . Objekte . MsgBox (Message-Box) → Fenster zum Anzeigen von Daten . InputBox → Fenster zum Eingeben von Daten. Programmierung . MsgBox. MsgBox "[Anzeige-Text]",[Buttons],"[Name des Fensters]" Der Anfang "MsgBox" kann auch nur in Kleinbuchstaben geschrieben werden. Inputbox. a=InputBox ... options − options are alternative choices that you may use to tailor a standard message box. Some of the options that you can use are default and parent. The default option is used to specify the default button, such as ABORT, RETRY, or IGNORE in the message box. The parent option is used to specify the window on top of which the message box is to be displayed. You could use one of the ... I think you will find that the standard MsgBox will handle three options as in VbYesNoCancel however if you need more and you'd like to name them yourself you will have to construct a custom UserForm/ MsgBox of your own to do it. RE: Multiple choice MsgBox SkipVought (Programmer) 28 May 08 07:54. Hi, Option Buttons, otherwise referred to as Radio Buttons. You can get a mutually exclusive ... options:There are a number of supported options. The options used in this case are text and command. text: button text ; command: the action or method that is to be invoked when the button is pressed. Return Value: The method returns a string (.!button) . Syntax: create_window(x, y, **options) Parameter: MsgBox( prompt [, buttons ] [, title ] [, helpfile, context ] ) prompt – This is a required argument. It displays the message that you see in the MsgBox. In our example, the text “This is a sample MsgBox” is the ‘prompt’. You can use up to 1024 characters in the prompt, and can also use it to display the values of variables. In case you want to show a prompt that has multiple lines ...

[index] [8832] [535] [17389] [17074] [10448] [2079] [3222] [169] [12668] [19036]

Free Binary Option Strategy Best Binary Options Strategy ...

Best Binary Options Strategy 2020 - 2 Minute Strategy LIVE TRAINING! - Duration: 43:42. ... Video Nro 2 - MsgBox - If Else End If - Abriendo ventanas - Duration: 36:21. Leopoldo Vasquez Blas ... How to trade in Binary options? What are the disadvantages of Binary options. Binary Option Part 1: Best Binary Options Brokers for this Strategy: 1. 💲💹IQ Option FREE DEMO: 2. 💲💹Pocket Option FREE DEMO: http FOREX & BINARY SIGNALS OPEN YOUR ACCOUNT IQ OPTION HERE: IQ OPTION FREE D... 🚩Certified Broker!🔔 Sign up to Get 💰Profit Offers💰👉 🚩Automated Binary Options Trading Software 👉 Iq option trad... how to use msgbox and inputbox in vb6 - Duration: 2:54. TPS Codes 9,332 views. 2:54. VBA New Line Character vbNewLine vbCrLF and Chr(13) - Code Included - Duration: 4:30. ... BINARY OPTIONS TRADING TUTORIAL Does 2-2+ mean loss? Hello everyone!:) My name is Anastasia, but it's too hard to pronounce, that's why you may call me just... 📣 BEST BINARY OPTIONS APP 2020 Best Binary Options Brokers: 1. 💲💹IQ Option FREE DEMO: IQ Options - subscribe and leave a like for more videos.Online trading is a very risky investment/profession. It i... Options are a powerful tool used by both stock investors, stock traders and forex traders. This is lesson 1 (Part 1 of 2) of the Professional Options Trading...