Jump to content

Several scripts will not run on NEW users pc


Recommended Posts

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.

 

EXE_Error.png

Edited by Melba23
Removed image
Link to comment
Share on other sites

  • Moderators

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

  • Moderators

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 by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

EXE_Error.png

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...