Does anyone know why the following mail-merge vb script would produce an error 424 - "object required"?
http://pastebin.com/93825YMi
The error occurs on line 41:
Set objTemplate = objWord.Documents.Open(sTemplate)
If I run the script from the command line it works fine. However, when it's started from a Windows service, it falls over when opening the Word document.
I've checked that the permissions are correct.
Many thanks!
Related
I am trying to overwrite one .png file with another using shutil.copy, but I keep getting a syntax error. The line in question is-
shutil.copy("/var/www/vk7krj/running/yoga.png", "/var/www/vk7krj/running/run4.png")
and the error is-
File "./latlong4.py", line 63
shutil.copy("/var/www/vk7krj/running/yoga.png","/var/www/vk7krj/running/run4.png")
SyntaxError: invalid syntax
with an up-arrow under the l in shutil
I have "import shutil" and also "from shutil import copyfile" in the head of the file.
Several hours of google searching has turned up nothing, so any assistance would be great.
Problem solved- turns out the error was incorrect indentation in an if-else earlier in the script- corrected that and the syntax error went away.
I'm switching to neovim and try to get nvim-go running. My Plug section in my init.vim looks like this:
call plug#begin('~/.vim/plugged')
Plug 'zchee/nvim-go', { 'do': 'make'}
Plug 'sebdah/vim-delve'
call plug#end()
If I open nvim and run PlugInstall, I get the following errors:
Error detected while processing
/home/domma/.vim/plugged/nvim-go/plugin/nvim-go. vim: line 20:
E121: Undefined variable: g:go#debug
I checked the file and the error makes sense. But I have no idea where this variable comes from, how it should be set. How can I fix this?
Temporary edit the line in /home/domma/.vim/plugged/nvim-go/plugin/nvim-go.vim: line 20
if g:go#debug -> if exists('g:go#debug')
I have encountered an error when running a batch file. It goes like this, I run test-setup.cmd which calls another batch file test-env.cmd
test-setup.cmd calls by using this line:
call %SCRIPT_HOME%\test-env.cmd
where SCRIPT_HOME is set up as SCRIPT_HOME=%~dp0
test-env.cmd has this line:
if [%TEST_HOME%] == [] set TEST_HOME=D:\Program Files\Test\test-02.2.3.Final
After running the test-setup.cmd a message appears like this:
Files\Test\test-02.2.3.Final was unexpected at this time
Note that I have setup the TEST_HOME in the system environment variables.
Please help, thank you.
The syntax of your if command is incorrect. It would work if %TEST_HOME% didn't contain any spaces, but since it does you must use double quotes:
if "%TEST_HOME%" == "" set TEST_HOME=D:\Program Files\Test\test-02.2.3.Final
Mind you, since you're just testing to see whether the variable exists, it would be a lot more efficient to do that directly:
if not defined TEST_HOME set TEST_HOME=D:\Program Files\Test\test-02.2.3.Final
I'm currently doing a python course through Security Tube. I've currently got stuck on one module where I have to run a Python script through XP and execute it through Immunity Debugger with a process in front of it.
Here's the code:
#!/usr/bin/python2.7
import immlib
DESC="Find Instructions"
def main(args) :
imm = immlib.Debugger()
assembledInstruction = imm.assemble (' ' .join(args))
if not assembledInstruction :
return "[-] No Instruction Given!"
addressList = imm.search(assembledInstruction)
td = imm.createTable("Instruction Locations", ['Module', 'Base Address', 'Instruction Address', 'Instruction']
for address in addressList :
# Get module for this address
module = imm.findModule(address)
if not module:
imm.log("Address 0x%08X not in any module" %address)
# Get module object by name. Please note we are not checking for page properties.
# exercises? :)
instruction = ''
numArgs = len(' '.join(args).split('\n'))
for count in range(0, numArgs) :
instruction += imm.disasmForward(address, nlines=count).getDisasm() + ''
td.add(0, [ module[0],
str('0x%08X'%module[1])
str('0x%08X'%address),
instruction
])
I've saved the .py file as spse-find.py. From there I log on to my XP through Virtual Box, open Immunity Debugger, execute Server-strcpy.exe. At the bottom of the program, I type in:
!spse-find jmp ecp
But upon this being executed I receive the following error:
pycommands: error importing module.
I've placed this in the Security Tube forums but the only thing which I've been told is that I should check the code syntax to ensure it's correct and to ensure that I'm following the video correctly. I've made the checks at least 4 or 5 times. I haven't received any further replies from them since that and so I was wondering if anyone would be able to provide me with any further insight to where I've gone wrong or where more code needs to be added.
Running your code, I get a SyntaxError:
C:\Users\kevin>test.py
File "C:\Users\kevin\test.py", line 20
for address in addressList :
^
SyntaxError: invalid syntax
This message is misleading, because that line is error-free. But sometimes the reported line number is off by one, so let's look at the previous line:
td = imm.createTable("Instruction Locations", ['Module', 'Base Address', 'Instruction Address', 'Instruction']
This is a syntax error. You are missing a closing parenthesis. It should be:
td = imm.createTable("Instruction Locations", ['Module', 'Base Address', 'Instruction Address', 'Instruction'])
Running the program again, we get:
C:\Users\kevin>test.py
File "C:\Users\kevin\test.py", line 38
str('0x%08X'%address),
^
SyntaxError: invalid syntax
This is another red herring. You forgot a comma on line 37.
str('0x%08X'%module[1])
Should be
str('0x%08X'%module[1]),
That should fix all of your syntax errors. (I can't vouch for the correctness of the program at run time, however, since I don't have the immlib library.)
Using immunity debugger is complicated to find out what is going on. The best way is calling the pycommand without the .py extension. That is, if your pycommand is correctly placed under the PyCommands folder and it is called "example.py", using the command bar at the bottom of the grafical interface you should call the pycommand in this way: !example --> instead of !example.py. The second option will compile the code and just tell you something is wrong, the first one will parse the content and tell you the line which is causing the script to fail.
I hope it helps.
Regards.
I am getting this error while trying to run a VBScript (note this is not in a web environment - just running a VBScript on Windows):
Line: [Last line]
Error: Expected 'End'
Code: 800A03F4
Source: Microsoft VBScript compilation error
I think it is an If statement that is not closed correctly with an "End If," but I've gone through every instance of "If" in the code and cannot find the error. Any tips or tools that could help me figure out where/why this error is occurring?
There was an "Else If" - there should be no space there: "Elseif"
http://www.w3schools.com/asp/asp_conditionals.asp
Hopefully this will help someone out in the future.
In VBScript If is not the only token that requires an End. Also look for Function's and Sub's without their appropriate end statements.