MarkH0708 Posted March 13 Share Posted March 13 (edited) As the title states, we have several scripts used to strip address information from a PDF (it links to an Access Database to gather coordinates based on the customer selected). I have a NEW employee who is unable to run these scripts. I tried logging into his PC as my user and also could not run them even though they run fine from my PC. I have the code for these scripts, but the error "line number" doesn't match up with the code as it exceeds the code length. I also tried a very simple code that I wrote while trying to learn some basics. This user IS able to run that simplistic script with no difficulties. I am out of ideas as to what to look for. I have already installed, uninstalled, installed, uninstalled, and then installed. I'm including a snip of the error as an attachment. We get different errors when running the EXE version than when the AU3 is run. Any help would be greatly appreciated. Edited March 13 by Melba23 Removed image Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 13 Moderators Share Posted March 13 Without seeing the actual code, it is more than a little difficult to divine what the issue is. However, from the error it appears the $PDFLib object is not being properly created, thus you are unable to call the UnlockKey method. It appears that you need to add some error-checking around whichever function/lines create the object itself to ensure that section does not fail. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Danp2 Posted March 13 Share Posted March 13 Which PDF library are you using to access the PDF files? It's possible that you need to install it or register a DLL. P.S. You may want to obscure it if that's your actual unlock key above. 😧 WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
MarkH0708 Posted March 13 Author Share Posted March 13 @Danp2 I can't see how to obscure. It won't allow me to edit it any longer. Link to comment Share on other sites More sharing options...
Danp2 Posted March 13 Share Posted March 13 @MarkH0708Likely because you are viewed as a new user. One of the mods will be by to unlock that feature for you. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 13 Moderators Share Posted March 13 (edited) MarkH0708, You should now have "Edit" priviledges. M23 Edit: And I have removed the image in question - just replace it with a redacted version. Edited March 13 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
MarkH0708 Posted March 13 Author Share Posted March 13 20 minutes ago, Melba23 said: MarkH0708, You should now have "Edit" priviledges. M23 Edit: And I have removed the image in question - just replace it with a redacted version. THANK YOU! Link to comment Share on other sites More sharing options...
mistersquirrle Posted March 13 Share Posted March 13 2 hours ago, MarkH0708 said: I have the code for these scripts, but the error "line number" doesn't match up with the code as it exceeds the code length. The reason for this is that when the script is compiled, all the code from the #include's are combined into 1 source file. As well there may be some things expanded/stripped/replaced in the version that gets compiled. There's an option when compiling to output the "stripped" version that should point you to the correct line: Quote Au3Stripper: /mo : Just merges the Include files into the source and strips the Comments. This is similar to aut2exe and helps finding the errorline. #Au3Stripper_Parameters=/mo Now when I compile I go from a ~175 line script to a 23571 line script (because I have a lot of included files in this test script). The files I have now are test.au3 (original), test_stripped.au3 (stripped/expanded original that should match your line number, though it may be 1 off now since you need to add the #Au3Stripper_Parameters line), and text.exe. Other than that JLogan3o13 and Danp2 posts are probably the answer, in that however you're creating your PDF object isn't working because the DLL or COM object isn't registered. You should add some logging/error checking around where you create the PDF object (ObjGet/ObjCreate) and make sure there's not an error. If there is, output the error and exit the script. Something else that you can do is if you're using a specific DLL or file for this PDF object, you can try to include it in the main script/exe with FileInstall: https://www.autoitscript.com/autoit3/docs/functions/FileInstall.htm But as mentioned, it's hard to give more information without knowing what you're using, and how you're creating the object. If you get the chance, try to post some code that is centered around where you're getting this error (likely with the ObjCreate/Get, and then calling the unlock part, obviously without your unlock code). We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
MarkH0708 Posted March 14 Author Share Posted March 14 We will begin digging into the DLLs to check on registration. As these scripts (both AU3 and EXE files) run for 3 of us in the department, I don't believe the code is wrong. I was just unsure what to be looking for. As you can imagine, deciphering someone's undocumented code that no longer works here is challenging. Thanks for the suggestions so far. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now