Stop Redrawing in VBA

Hello,
I try (or better ife done) a complexe Script in VBA.
It accesses directly Indesign and send Line by Line all Stuff to Indesign.
So i DO NOT load the script in Indesign, i execute it directly in my VBA Application.
The Problem is tthe Redrawing. I cannot stop it by simple set the preferences. these preferences will be ignored.
The issue is not only the low Speed, its also the hangups after 40 or 50 Pages.
Indesign itself works trough but all interfaces get scrambled. you can only press alt-f4 after finisching the script and save the file and restart indesign --- not a fine solution.
if i open an Menü in Indesign while the script runs (lets say fileopen. everything is fine and the script is about 10 times faster.
SO the question is how can i stop indesign from redrawing when i script from the outside of indesign.
i alos found an idea in this forum for running into the background (by minimizing inseign) but this wont help. if you minimize it the same effects and low speed. only open an menue helps but i really dont like it.
so anyidea how to to this OR run indesign real in the background ?
thanks in advance and sorry for my bad english,..

B.O.f.H. wrote:
SOrry but you do not understand.
Its not possible to check conditions with doscript if the conditiions based on the status of the record (or better status of every field fo the record) against the database. so you have to make an preprocessing where you hook all the data to doscript
but your "DoScript" can check these conditions for you
B.O.f.H. wrote:
BUT this isnt suiteable too or how you wanna send doscript 900 records with 90 fields?
as a string? lol
why not ?
you can even place your data in TextFrame as raw data and "DoScript" can process it - many times faster than you can do this by external application
B.O.f.H. wrote:
Doscript cannot check it faster faster than my own application. doscript cannot check it anyway. since when has doscript an own connector to an sql database? --- i dont know why youre so in liove with doscript but this method is only useable under special circumstances and  might be make sense only for special needs. your descriptions is a absolute false use of that method
you really know nothing about DoScript script in DoScript can do THE SAME THINGS as you can do in external application I'm not sure about how complicated can be interface - if can be at all - but you can connect to the same applications and call the same queries like you can do in external app
B.O.f.H. wrote:
its against every (proffessional) programming method workout code like this.
your comment that you can comment the code is useless. that wont work if youve a real complex code. its hard enough to reread it when its a clean thing and commented
sorry, but again - you know nothing about writing scripts for InDesign
trust me - sometimes - building script for DoScript method and calling it by this method is 10 times quicker than doing all by external application if you don't want to trust me - ask Olav
and if you can't read your own comments ... no comments
B.O.f.H. wrote:
32kb ? you think that will be enought :-) youve no idea what im doing there lol
sorry im not alowed to show even the layout or any prticiular information. its part of the contract.
yes - I have no idea if you can't show as - try to describe - you don't need to use informations what colors and sizes and shapes and exact positions of all objects tell us how many TextFrames, Rectangles and other objects you have - and what is this - newspaper or catalog ?
B.O.f.H. wrote:
we do not write a simple scritp doing a or b and give it for download elsewhere. its an complete export modul.
better its part of that module, we are exportig to different applications
what you can see on my web page - is 1/4 or even 1/5 what I have done
some of my tools "do a or b and can be downloaded" but I have many special apps created for particualar needs of my clients and you can trust me - these apps aren't simple and slow and when app is too slow for me - even if fast for client I always try to find better way to make it even faster
for example - tool for building ads to newspaper - first version - 2 hour to lay out 15 000 ads - finall version - less than 30 minutes
and nothing hangs or stops
B.O.f.H. wrote:
by the way telling someone to rewrite the hole module only to... hmm why should i use doscript again? which things does it better solve than now? nothing? making it more complex ?
works faster and can do the same things you can do in external app
B.O.f.H. wrote:
but anyway do you think anyone will pay such redesign witout an viewable better result? so even its the perfect solution its not suiteable to rewrite everything. simply it would be myfreetime (and this is so rare that ill need about 2 years to finish that lol)
after writing many different scripts - I know how to write next script ... I don't repeat the same mistakes
B.O.f.H. wrote: btw if you execute it directly its easy to see make a memerydump - or provokate a bluescreen and windows do it for you hehe
and i dont know but i think you can stop scripts in indesign and debug them
I have never seen bluescreen caused by DoScript
and no - you can't stop and debug script created as string and called by DoScript method - it just don't exist
B.O.f.H. wrote:
about the binarydata thing... gain we dont use a script in indesign. we use the dll interface in VB and talk to all objects in indesign directly.
by something like this ?
Set myInDi = CreateObject("InDesign.Application.CS3")
B.O.f.H. wrote:
thats why doscript cannot check anycondition even cannot insert the data correctly because we filter every dam string bevore its going to indesign -  we have to because we have no influence what the user will type in into the database - stringlenght can be to long (and other issues like injections) so its also a really bad programming lettings simply all strings from an database into your function without an filter.
ok - but you can preprocess your data from database and build DoScript with filtered strings, and once again - you can add all conditions to "DoScript" and they can be processed much faster
B.O.f.H. wrote:
we do not develop indesign scripts, we develop software in 4 languages. we do not simplyscript or so. its a complete module in our application while the most functions use other objects from our own software so i cannot split it without reproducing and doubling additional tousends of lines
and doubling the code is something you should never do
once again - sorry, but you know nothing about writing scripts for InDesign
robin
www.adobescripts.co.uk

Similar Messages

  • Screen stops redrawing after 100 documents are generated [mac/js/cs3]

    I wrote my thesis this semester in InDesign, a script which takes a folder of content and does a page layout based on that content. For our thesis show I'd like to have the script running in a loop. I've writen it so it creates a document, makes it look nice, pauses for 5 seconds, and closes. This works perfect...
    ...except after 100 documents (exactly 100 it seems), it stops redrawing the screen. The document is pure white, the rulers only draw halfway...not very impressive at all. This doesn't happen on my unibody MBP (at least, not at 100) but on the G5 we have to use at the thesis show.
    Is there anything I can do about this? I have it changing from Normal to Preview mode on every cycle, do I have any other options or should I try and limit the script to 100 runs and then maybe call it via do script and wait until it's done?
    The thesis show opens Tuesday, we've been very limited in the time we have to test with the machines so any alternatives would be great.
    Thanks so much.

    This is not a real answer, but perhaps you could record a video of the script running once, and then playback the video in a loop? I'm sure you'd like to avoid this...

  • Windows occasionally stop redrawing

    We have a LabVIEW exe that consists of multiple windows, each with a bunch of numeric indicators that regularly (typically ~1Hz) update. The application is typically run for 8+ hours at a time. Occasionally (and seemingly randomly) we see one or more of the windows just stop updating. The problem is almost certainly not a coding thing, as each window is basically just a while loop with a timeout and some values going to the indicators. And there is no evidence of any blocking calls or thread contention. Further, the problem is resolved simply by minimizing and restoring the window.
    We run on Windows 7 Enterprise. My first thought was that the problem might be related to the Aero effects and Desktop Windows Manger (DWM). I actually tried disabling the DWM Session Manager service on all the workstations, but we have still seen the problem (although it *might* have reduced frequency somewhat...the jury is still out on that one, as the change was implemented pretty recently).
    Because the minimize/restore trick seems to work, I am inclined to believe the issue is at the OS or video card level. Like, the OS is trying to reduce redraw overhead by skipping some windows that it thinks aren't being viewed.
    So, my questions are:
    Has anyone else seen this problem before?
    Does anyone have any ideas of what the root cause might be, and/or what other steps we might take to mitigate the problem?

    Travis-E wrote:
    This is a known issue with applications running with Windows Aero. A work around that may be useful would be to disable windows Aero. Here is a link that goes through the disable process: http://www.howtogeek.com/howto/windows-vista/disable-aero-on-windows-vista/. Here is the CAR number so you can track this issue: 369142. I apologize for any inconvenience this may cause.
    -Travis E
    I like this post.  It's like saying "This is a known issue with cars that have radial tires.  A workaround that may be useful is to put bias ply tires on your car." 
    LOL I figure that NI is making this a top priority, but since it's very difficult to convey urgency in text, it sounds like NI is completely disaffected.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Redraw problems on secondary monitor with 2 Acrobat documents

    When I have two overlapping Acrobat 9 documents open on my secondary monitor and I click on the Acrobat doc in the background to bring it to the front, the image from the Acrobat doc that was in front is captured in the Acrobat document that I brought to the front.
    I can't reproduce this problem on my primary monitor with Acrobat, and I can't reproduce this problem with any program on my secondary monitor. And I can't reproduce this problem on my secondary monitor with two document open with Adobe reader 8.0
    Window 2003 XP 64bit, SP2
    ATI FireGL V7350, primary/secondary
    Dual Dell 2407 WFP
    ASUS P5W DH Deluxe MB
    Intel Core2 x6800

    I have the same problem here, but with either monitor.
    Dell Precision T7400  Quadcore Xeon with 4GB RAM & Windows XP 32bit, Quadro 1700, two Dell 2001FPs (1200x1600)
    Both my monitors are rotated 90' in Portrait mode. In landscape this doesn't appear to happen.
    Acrobat 9.0 Pro, now patched to Acrobat 9.1
    I can view full-monitor for a while, but then Acrobat stops redrawing/repainting properly when the window size exceeds a (variable) limit.
    As a work-around, I start making the acrobat window size smaller until the window will redraw.
    As time goes by, I have to keep making the window size smaller and smaller to get redraw work.
    Eventually the window size required for redraw gets small enough that it's just too annoying and then I reboot the machine which makes it all good again for a short amount of time.
    This and the OCR bug are my two biggest issues with Acrobat 9.

  • Strange double buffering bug

    Hi all,
    I have stumbled on strange swing behavior on Windows, most probably connected to double buffering introduced in java 6.
    Once in a while Windows stops redrawing my JFrame. From the java side everything seems ok - all the components are painted (that is, all native methods called), EventQueue normally processed by EDT, but repainted GUI is not shown on the screen. Note that OS has the repainted info - if I cover part of the application window with another window (e.g. explorer), and hid it back, the part that was covered is repainted. This happens even if I have java app halted on debug, so no other java actions can cause this repaint - OS has to have this image, it just does not put it on the screen. When I minimize/maximize the app, everything goes back to normal.
    Note that I can normally operate the app "as if" it was painted - I can change tabs, click buttons (even though I can't see them), and results of these actions are painted by java to some offscreen buffer, but are only shown when I cover/uncover my app with another window, or min/max it. Min/Maxing ends this strange state and further repaints are shown normally.
    Did any of you have this kind of problem? Any idea how to approach/resolve it or what can be the cause?
    Java is 1.6.20, I have seen the behavior on Windows XP, Vista and 2008. It is not reproducible, it just happens sometimes. I haven't seen that on Java 5. Turning off double buffering resolves that, but is not feasible due to degraded user experience.
    Thanks in advance for your help!
    Jakub

    Thanks for your help so far, perhabs this is something with the driver, but I use fairly generic windows distribution.
    EDT is not hosed, it is processing events normally (I checked that on debug step-by-step). We do not override any paint methods, and this is rather something on different level - it is not "a component not being repainted" it is "everything is repainted, but not shown on screen". Including tabbedPane's tab changes, menu display, etc. I can even see cursor changing into carret when I hover over "not shown" textfield.
    Displaying and then disposing of modal dialog also fixes the state, as do resizing of the JFrame.

  • Trouble with booting system after upgrade udev= systemd

    Hi everybody,
    I have been trouble with my system since last upgrade (udev => systemd)
    My issue is something like this: https://bbs.archlinux.org/viewtopic.php?pid=1106157 but advice from this discussion doesn't work.
    When system booting, *immediately* (very fast, too fast) display login screen after start parsing hook [udev]
    Of course, i can't login - type username and i have redraw screen again on all /dev/tty* - i have no chance to type password.
    Many invalid logins suspend init for 5 minutes and allow me see display error due stop redraw screen - libpam.so.0 cannot find.
    I suspect that, partitions aren't mount (this fast login screen doesn't have even hostname). I have a 4 discs, with many partitions - mounting
    this take a some time (+- 5 secs).
    In rescuecd, i can mount all partitions and chroot. In chroot all works fine - /bin/login (i was checked authorization on all users),
    paths and pams are ok. Of course i try ,,default rescue trick'': `pacman -Suy linux udev mkinitcpio` and 'mkinitcpio -p linux' on rescuecd
    but nothing it's changed after reboot. I checking grub config, and unpack and check initramfs-linux.img - all ok.
    In my mkinitcpio.conf ofcourse i have MODULES="ext3" (for my filesystems).
    Please help.

    crab wrote:
    This may or may not be related... but I saw this message just now during an upgrade:
    (121/168) upgrading mkinitcpio [###################] 100%
    ==> If your /usr is on a separate partition, you must add the "usr" hook
    to /etc/mkinitcpio.conf and regenerate your images before rebooting
    And am wondering what the message means by if /usr is on a separate partition - separate partition to what?  /boot? / ?
    I have my /usr partition in the same partition as /  (but /boot is in a different partition)
    Logic tells me I'm safe (haven't rebooted yet), as / is "master", and anything else is a separate partition, and I have /usr on the same partition as /.
    Do you guys have separate /usr and/or /boot partitions?  As stated in first sentence this may not be related, but looks important...
    It means separate from /. So yes, you're right, you are "safe" from having to do anything with this message on your system.
    And to the other people on this thread: make sure you do have all your packages uniformly updated, including any pam-related AUR or ABS-build packages. libpam and the pam module directory (.../lib/security) were moved from /lib to /usr/lib a little while back, so make sure that anything that cares about where these may be have been updated so they aren't confused by this move.
    Last edited by ataraxia (2012-06-03 22:40:22)

  • Go to command in background freezes session.  Any Ideas

    I have an issue where Logic 8 and 9 locks me out if I use my "go to" key command (set to .) after recording while Logic is still processing the recording.
    What happens is somehow in the background a second "go to" command is created, but it doesn't show up anywhere on screen, so it is impossible for me to hit OK or cancel. I only know this because on my Logic Control it shows up. When I hit OK or cancel on the Logic Control Logic it solves that problem, but Logic stops redrawing the screen which makes it impossible to work. If I don't hit OK or Cancel on the Logic control, then Logic doesn't respond to the mouse and in 9.0.1 gives me that white flash. The application menus at the top work, but almost everyhing is greyed out, or doesn't work. Luckily though Save usually works, but then I have to force quit and restart, which really slows down the recording process.
    Has anyone else experienced this? Any ideas? I already tried reinitializing my key commands and setting them up from scratch and that didn't work.

    dmarocco wrote:
    I have an issue where Logic 8 and 9 locks me out if I use my "go to" key command (set to .) after recording while Logic is still processing the recording.
    90 % of all crashes I have come from this same 'impatience'. My advice to you and to myself is: wait. Let the processing finish before hitting keys or tweaking controls. This especially applies to 'beachballs' (the spinning rainbow cursor). Don't touch your keys until it's gone.
    What happens is somehow in the background a second "go to" command is created, but it doesn't show up anywhere on screen, so it is impossible for me to hit OK or cancel.
    If you think there's another window somewhere, just use the yellow button on the top left of the windows to get 'm out of the way.
    "." may not be the best choice for this command, either. Easy to accidently hit when you depress the command key or spacebar. Suggestion: assign it to "g".
    HTH,
    regards, Erik.

  • Can I avoid this problem?

    Hi all,
    I made a game by flash and projected it into .exe file. It
    runs correctly excepte one thing.
    In this game, I used onEnterFrame and setInterval to make
    counters to coundown and do something.
    But when player holds down the movie's title bar by pressing
    down the right mouse button, the movie stops redrawing.
    So onEnterFrame and setInterval stop doing their jobs.
    Does anyone know how to avoid this problem?

    HI ,
    can anyone help me?
    I am confused whit this problem for a long time.

  • [SOLVED] NVidia, Xorg, Output not reaching monitor?

    Hardware...
    ====================================================
      Computer: ASUS K55VD Laptop (UEFI Motherboard)
      Processor: Intel i5
      Graphics: NVidia GeForce 610M, also the Intel chip that I'm not using (I think)
    Relevant System Information (I figure maybe the location of my initramfs is messing with driver installation?)...
    ====================================================
      Partitioning...
        sda1: /boot (FAT32)
        sda2: / (ext4)
        sda3: /home (ext4)
      Boot: Syslinux EFI setup using efibootmgr (ESP: /boot, Syslinux: /boot/EFI/syslinux)
      Driver package: "nvidia", corresponding libgl and lib32 stuff. NOTE: I know this is the wrong version, but my problem is _exactly_ the same with nvidia-304xx.
      Xorg Configuration (no other conf files influencing outcome, no ~/.xinitrc)...
        /etc/X11/xorg.conf.d/10-evdev.conf
        /etc/X11/xorg.conf.d/10-quirks.conf
        /etc/X11/xorg.conf.d/10-server.conf
        /etc/X11/xorg.conf.d/20-nvidia.conf
    Other Notes: The laptop originally came with Windows 8. At the time, I didn't want to spend a whole lot of time installing Arch, so I chose Ubuntu for the time being. While Ubuntu was installed, I noticed that the driver being used was called "Mesa", and certain applications didn't like that (NCAR's VAPOR, for example). Perhaps there's a problem with the hardware that's causing Ubuntu to choose an alternate install system, and now I'm running into that?
    Problem...
    ====================================================
    I've set everything up properly according to the Beginner's Guide, NVIDIA and Xorg pages.
    I run startx.
    At "Loading extension GLX", the whole TTY freezes (stops redrawing, can tell because cursor freezes in current state <on/off>).
    At this point, I can still switch TTYs with C-M-F<n>, so it's just that one TTY.
    I can type "exit", <Enter>, and then the server dies dramatically.
    Here's the full output from the server, which had to be unjumbled by redirecting all output to a file
    Here's my /var/log/Xorg.0.log, recovered after the test
    I was even able to retrieve this glxinfo output by piping to a file!
    Again, I was typing blind, so there's no real guarantee that the glxinfo output is, in fact, glxinfo output...
    Analysis...
    ====================================================
    I have no idea what the problem is on the server's shutdown, but I've got ideas about the rest of it.
    I figure what's happening is that the server is starting just fine, but it isn't putting output on my monitor. It opens the twm environment, which starts with an open terminal. When I type "exit", <Enter>, the server shuts down again, as expected, but something goes wrong.
    That's how it occurred to me to grab that glxinfo: 'glxinfo > ~/test'
    Does the following mean that it's actually using the Intel graphics? (found this in Xorg log)
    [  1571.248] (--) PCI:*(0:0:2:0) :::this refers to the Intel graphics
    [  1571.248] (--) PCI: (0:1:0:0) :::this refers to the 610M
    What does that asterisk (*) mean?
    Does this line mean that my graphics card isn't hooked up to my monitor?
    [  1571.383] (--) NVIDIA(0): Valid display device(s) on GeForce 610M at PCI:1:0:0
    [  1571.383] (--) NVIDIA(0):     none
    Maybe I need to configure my monitor to be detected somehow?
    I noticed two errors in the Xorg log that might be related...
    [  1571.385] (EE) NVIDIA(0): Failed to initiate mode change.
    [  1571.385] (EE) NVIDIA(0): Failed to complete mode change
    Maybe there's a simple package installation that will fix everything?
    If there's any more information you need, please ask.
    Thanks!
    PS: wgetpaste was EXTREMELY helpful!
    Last edited by soccermiles (2013-12-22 23:23:40)

    New Progress!
    I've managed to get my screen to go black during the server's run, instead of having my TTY just freeze!
    I followed the instructions here
    However, now I have the problem that the X server shuts down about two seconds after startup. I have confirmed that both of the xrandr commands are completed.
    Here is my x log
    Here is my x output
    As you can see, we have "Screen 1 deleted because of no matching config section". I have no idea what that means.
    The NVIDIA driver still appears to try setting mode "NULL" (maybe it isn't getting the available modes properly?)
    At the end, there's this weird thing...
    reporting 3 4 17 122
    have a master to look out for
    adjust shatters 0 1366
    need to create shared pixmap 1(II) NVIDIA(GPU-0): Deleting GPU-0
    Uhhh...why is it deleting my GPU? (I have no idea what it means by that)
    UPDATE (again!)...
    I HAVE LWM WINDOWS APPEARING! (but I had to stop the nvidia to get that)
    I changed the ServerLayout to have Screen 0 be the "intel" screen.
    Initially, input wasn't being handled at all, resulting in complete inability to do anything once x started
    I managed to get input working by adding some xorg configs for my input devices (now I have fully-functional xorg, but without my nvidia card)
    I still want to get my nvidia working.
    Last edited by soccermiles (2013-12-22 19:31:50)

  • Bug? SMTP send hangs LabVIEW

    I am trying to send an email during an alarm state using the SMTP VIs included with LabVIEW (2013, have not tested 2012).  It seems that the SMTP send VI hangs LabVIEW while it is running to the point that my software doesn't start shutting down because LabVIEW is waiting for SMTP send.
    SMTP send is running parallel to everything else, so it shouldn't cause a hang just because it hasn't finished running.  The UI stops redrawing (i.e. if I open a window in front of the program and close it, LabVIEW doesn't redraw the front panel - I still see the old window), every parallel process in the code stops running, and the cursor changes to the busy cursor while it works away.
    Today at my office, this delay is 3-5 seconds.  Last week when testing at my customer, the delay was 20-30 seconds.  The email always gets sent, but it seems while it is logging into the mail server and doing whatever transactions are necessary, LabVIEW is non-responsive.
    Please note I am sending a 1-2 sentence email with no attachments.  I am not use SLL/TLS, although my server does require a username and password login.
    Is anyone else seeign this?
    Thanks,
    Matthew

    Joel,
    Same behavior.  As I noted in my original post, it locks up at send.  If you have a fast connection to your server and are sending a short messsage, you may not see it.  My server has a delay for loggin in and it is not internal, so it takes 5 seconds or so for it to login, and send the email.  During that time, LabVIEW is non-responsive.
    If you have a quick connection, you may need to try using the vi that sends attachments so the session with the server lasts longer.
    The issue is specifically with vi.lib\smtpClient\Send.vi.  It is password protected, so I cannot determine exactly what is locking up, but it is in there.
    For now, I found an example on the forums that is not very robust, but got me through the immediate problem.  It can send an email without locking up LabVIEW, so I know NI's code is doing something it probably shouldn't be.
    Matthew

  • SAPGUI scripting via. Excel

    We have a inhouse SAPGUI scripting tool (not really sure if it is Inhouse or SAP delivered it) that we currently use to perform Mass updates via. Excel. The person who created this has left the company but now we have a need to update this. I have no idea of how it was developed. It just seems like it was customized from available scripting functions alread yavalable. This was created in 2003 and obviously it is outdated.
    How it works:
    We install this tool/plugin, and it creates a menu item in the Excel called SAP Scripting and it has Connect to SAP, Play, Record, Stop, Generate Input Sheet as options. Wehn you click connect to SAP, it brings up the Logon pad and allows the user to select a system and logon. Then yo ucan click Record and it will capture all the transcations and when you hit stop and click generate input sheet, the script is ready. The script looks something like the below but below is not complete.
    Issue:
    The script is converting all the Input Values to UpperCase but when we use this to populate some paramets which are case sensitive, we are having issues. We need to figure out a way so that the script doesn't convert the input values to UpperCase.
    have nayone seen this type os scripting tool? Any advice?
    IsInput     ID     ScriptCode
    START     001     
         002     MySession.findById("wnd[0]").resizeWorkingPane 95,25,false
         003     MySession.findById("wnd[0]/tbar[0]/okcd").text = "/nsu01"
         004     MySession.findById("wnd[0]/tbar[0]/btn[0]").press
    X     005     MySession.findById("wnd[0]/usr/ctxtUSR02-BNAME").text =
         006     MySession.findById("wnd[0]/usr/ctxtUSR02-BNAME").caretPosition = 6
         007     MySession.findById("wnd[0]/tbar[1]/btn[7]").press
         008     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpLOGO").select
         009     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpSNC").select
         010     MySession.findById("wnd[0]/tbar[1]/btn[19]").press
    X     011     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpSNC/ssubMAINAREA:SAPLSNCB:1002/txtUSRACL-PNAME").text =
         012     MySession.findById("wnd[0]/usr/tabsTABSTRIP1/tabpSNC/ssubMAINAREA:SAPLSNCB:1002/txtUSRACL-PNAME").caretPosition = 21
         013     MySession.findById("wnd[0]/tbar[0]/btn[11]").press
    STOP     014

    Standard Excel VBA uses UCASE to convert text to upper case.

  • Populate a PDF with VBA and FDF, stopped working.

    I work with a non-profit children's camp where I need to be able to populate a PDF form from a MS Access database. The problem is that I do not have much server access, so I've had to find sneaky ways to do this. I can not use anything I have to install. I have been using FDF and VBA because it is what I know. Last year it stopped working in Chrome. This year it won't work in Firefox or IE either. I have to assume some change in security. It seems the problem is that PDF no longer open in my browser but download to the temp folder and open with Acrobat. This of course keeps my form from contacting the server to populate the form. I had been using a "update data" button to populate the form that opens in browser. Does anyone know of a way to do what I am trying to do without purchasing expensive software. I need to rely 100% on the user having reader.
    The file can be downloaded or viewed here (though it doesn't show the button unless you download, though it used to);
    http://www.camphunt.com/data/pdf_registration.pdf

    I guessed that was the case but testing it on several computers then and now the default handling seems to have changed. I am now looking for a way to do this either a different (but similar) way or to somehow get around this change.

  • Is it possible to stop the continual redraw

    Hi I was wondering if it was possible to stop Lightroom continually redrawing images, especially when switching to Develop mode.
    I have tried rebuilding all the 1:1 Previews - this seems to help the redraw problem in Library mode - both for thumbs and when double clicked - but not in Develop mode.
    It doesn't seem to make sense that when I select a photo in the Library thumbs mode, then hit D (for Develop), I see the photo enlarged and clear for a split second, then Lightroom starts to redraw it, and eventually produces the image I saw for a split second. It's like it has the information but doesn't use it. This sometimes happens when in "Fit" view, especially with heavily cropped photos, and nearly always seems to happen in "1:1" view.
    I have also tried optimising catalogs - this seems to make little or no difference.
    Computer setup: early Intel iMac Lightroom 2.2, OS 10.5.6, photos on external drive, catalogue on iMac, Canon Raw files (.CR2) about 20 to 30 Mb each,
    LR Preferences:
    file extension:dng, jpeg preview:medium size, compressed (lossless) ticked, embed original raw file not ticked, Cache on imac, max size 12 Gb (should this be bigger maybe?).
    Catalogue settings: Standard Preview size: 1680 pixels, Preview Quality: High, Automatically Discard 1:1 Previews: after 30 days.
    Many thanks for any help with this

    Well thanks for the quick answers! At least I won't be wondering if there's some setting I can change.
    Of course I understand why the image should show changes made in Develop mode in "real-time" - and, in fact, that works fine with no delay, if I increase the contrast, for example.
    What I don't undestand is why without making any changes, on opening the picture in Develop, it shows the picture, then it goes all blocky ("big pixels") for a few seconds, then it goes back to normal

  • Microsoft Excel Has Stopped Working at End of VBA Code

    I'm using Microsoft Excel Professional Plus 2010.  My code essentially looks up a date in a different sheet, copies it to another sheet in an organized location, and prints to PDF.  If I run the code for a period longer than a couple months ago,
    at the end of the VBA code, it states "Microsoft Excel Has Stopped Working", quits, and recovers.
    I added in a piece of code at the end to save the workbook, which it does, then it quits.  I can reopen the document and all my work is saved.  There is something going on I can't put my finger on but for some reason it only happens when I'm dealing
    with more information than usual (a couple months worth, possibly only 20-30 rows of info).
    Any suggestions?  Thank you in advance!
    Dan

    Hi,
    In regarding of the issue, we'd better do some tests to narrow down the issue and find the root cause.
    Please copy the file with code to another PC (We'd better use the similar environment) to test.
    First, if it works well, this issue might be caused by the Excel or other program in your PC. I recommend we follow this KB to troubleshoot:
    http://support.microsoft.com/kb/2758592/en-us
    Then, if the issue still exists, we could collect the Event log and App crash dump file to do deep troubleshoot.
    Second, if it still crashes Excel 2010 in other PC, it might be due to the VBA code. I suggest you upload the code and post the issue to MSND forum for Excel to get more help.
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards, 
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Excel 2010 - Userform - VBA How to stop 'Job No' from duplicating itself on next empty row

    
    Hi there
    Thank you in advance for taking the time to check this out.
    Objective:
    To prevent duplication of incident numbers in the datasheet, and format the job number with a prefix of
    Inc- at the beginning. I currently have the cell customization set to “Inc”General but that only inserts the prefix in the cells on the datasheet, but is not showing in the disabled textbox in the userform.
    The Problem
    I have a ‘Job Number’ that is generated each time the form is opened and when the ‘Save’ button is clicked the data from the form is transferred over
    The job number is generated from the previous entry +1 (auto incrementing the old fashioned way).
    The problem arises when the ‘Save’ button is pressed repeatedly, the same job number and data is duplicated on the datasheet.
    Is there some way to ensure that the number generated is unique, and if the ‘Save’ button is repeatedly pressed that it will just over-ride the existing information?
    The number format currently used is 20150003 (incremented by 1). But what I’d like to be displayed in the form is
    Inc- 20150003
    The following code is in the form_initialize procedure.
    Me.txtSEC_INC_No.Enabled = True
    Dim irow As Long
    Dim ws As ws_Incident_Details
    Set ws = ws_Incident_Details
    'find last data row from database'
    irow = ws.Cells(Rows.Count, 1) _
    .End(xlUp).Row
    If ws.[a2].Value = "" Then
    Me.txtSEC_INC_No.Text = 0 ' If no value in Col A, it will return a 0
    Else
    Me.txtSEC_INC_No.Text = ws.Cells(irow, 1).Value + 1
    End If
    I’d be really grateful if someone could help me out, or perhaps direct me to where I might find some coding that will achieve the result I am seeking.
    I have just uploaded the latest version
    My Sample form is linked to my Dropbox so you can see how it currently works (or doesn't work)
    With much gratitude,
    TheShyButterfly
    Hope you have a terrific day, theShyButterfly

    I am striving to improve my VBA but ... I am far from anywhere near in understanding the code that you have in your file. I feel really bad in saying that, but I am not a pretender, and will acknowledge when I am over my head.
    I was thinking "simplified" :) ...
    Don't worry, also Rom wasn't build in a day. :-)
    I already answered the question about the duplication of the Job number in this thread:
    https://social.msdn.microsoft.com/Forums/de-DE/52f3c62f-b26e-4573-b7c2-8e7203786d7f/excel-2010-vba-userforms-vlookup-via-textbox-display-result-in-another-textbox?forum=exceldev
    So let us talk a little about the TAG property, thinking "simplified" and how to save the data:
    Most people start with code like this when they start there first Userform:
    Cells(MyRowNumber, 1) = txtBoxA
    Cells(MyRowNumber, 2) = txtBoxB
    etc. many many lines till
    Cells(MyRowNumber, 56) = txtBoxWhatEver
    And then, after Version 1.0, they realize that they also want to load data from a row into the form. And they copy all the lines and exchange
    the parts before and after the
    "=" like this:
    txtBoxA = Cells(MyRowNumber, 1)
    txtBoxB = Cells(MyRowNumber, 2)
    etc. many many lines till
    txtBoxWhatEver = Cells(MyRowNumber, 56)
    And maybe you have another 56 lines to "clear" the Userform, and maybe more lines... over 150 lines just for this... that is really tremendous.
    I will not be
    too harsh,
    if it works, then
    it's okay.
    But often many people struggle when they look into the code because, which column in the sheet is written by this line?
      Cells(MyRowNumber, 56) = txtBoxWhatEver
    I've often seen that people change the code to this:
      Range("A" & MyRowNumber) = txtBoxA
      Range("B" & MyRowNumber) = txtBoxB
    etc.  till
      Range("BD" & MyRowNumber) = txtBoxWhatEver
    which is more clearly, but you must revise
    150 lines!
    And that is the point for the TAG property, which is in fact just a string. So when we write the column name ("A", "B", etc.) into the TAG property of a control, you can change the code to this:
      Range(txtBoxA.Tag & MyRowNumber) = txtBoxA
      Range(txtBoxB.Tag & MyRowNumber) = txtBoxB
    etc.
    And now the 1st trick, we can use a loop and visit all controls at once:
      Dim C As MSForms.Control
      For Each C In Me.Controls
        If C.Tag <> "" Then
          Range(C.Tag & MyRowNumber) = C
        End If
      Next
    And when we want to load data from a row into the form, it's the same, just the other direction:
      Dim C As MSForms.Control
      For Each C In Me.Controls
        If C.Tag <> "" Then
          C = Range(C.Tag & MyRowNumber)
        End If
      Next
    And to clear the form is also the same:
      Dim C As MSForms.Control
      For Each C In Me.Controls
        If C.Tag <> "" Then
          C = ""
        End If
      Next
    So we can remove over 150 lines and do the same with just the 18 lines above.
    Isn't that a simplification?
    Think about that for a while.
    Ready for the next trick? ;-)
    As the TAG property is readable and writeable we can use Sub UserForm_Initialize and save a lot of manual work:
    Private Sub UserForm_Initialize()
      Me.txtBoxA.Tag = "A"
      Me.txtBoxB.Tag = "B"
      'etc. till
      Me.txtBoxWhatEver.Tag = "BD"
    End Sub
    No time to waste,
    here comes the next one. ;-)
    In your file, you can have named ranges, but always have headings! And so we can get the column name e.g. from a named range:
      Me.txtBoxWhatEver.Tag = GetColumnName(Range("WhatEver"))
    Function GetColumnName(ByVal R As Range) As String
    Dim S As String
    S = R.Address(1, 0)
    GetColumnName = Left(S, InStr(S, "$") - 1)
    End Function
    Or you can use Range.Find and search for the header int the sheet and get the column name directly.
    The benefit is that your form works even when the user change the layout of the sheet!
    Simple
    as it gets
    (almost).
    Andreas.

Maybe you are looking for