Application.OnTime in Visual Basic - vba

Application.OnTime when:=Now + TimeValue("00:02:00"), Name:="Convert_NextGen_Doc_to_PDF_Realtime"
This was working fine when we had it running on a Windows Server 2008 with MS Word 2010 but as soon as we updated it to Windows Server 2012 R2 and MS Word 2016, it stopped working. Once the 2 minutes has passed in the delay, the macro won’t run and the only way you can get it to work is connect to the server and then the macro seems to “wake up” and then it picks back up and runs fine. I wanted to see if it was something with the server version or if the server was going into “sleep mode” so I installed the macro on my computer. It would do the same thing to where once the 2 minute delay passed, the only way the macro would run would be when I made Word my active window and then the macro would resume running.

Related

Excel, VB macro, MSCOMM and standard user

I have a device operated via Excel through com ports with MSComm32. Some macro linked to buttons on Excel forms used to make this device work properly. Up to these last days when it suddenly stopped working.
After some investigations, it seems there are some security considerations applied within Excel. The Excel file used up to now does not work anymore if Excel is runs as a standard user. An error message indicates the control cannot be created when trying to enter the creation mode, for example. But, if Excel is run as Administrator, then everything works fine.
Is there an easy way to fix this? For example granting access rights to standard user for the module MSComm32 OCX?
Thanks!

Query time out error while handling multiple queries in a single form

I am developing an inquiry screen having totally 13 tabs consists of 13 grids. When the entire process running on the given selection criteria on the button click it taking too much time to execute and giving time out error. I am using visual studio 2005 and all server 2008 R2. While individual running the SQL' S they are working fine. Please suggest me the solution for this.
Increase the timeout of your Command object or optimize your sql query to take less time.

Access 2010 report ignores filter placed on it

I have run into an error with an Access Database created in MS-Access 2003. It's known the Calendar Control was deprecated in Access 2010 but unfortunately we need to keep using it. As a temp fix (until we can change to the date picker) we restored the MSCAL.OCX file on all 2010 users.
The issue:
We have a form to print schedules from a date range (using the calendar control). There is some VBA code to check to dates etc to make sure the range is accurate etc.
Everything works fine in 2003 but in 2010 the dates get selected fine on the form, is passed to the report (a print preview) fine as it displays in the footer BUT the query ignores the date range and prints ALL records (not just the records in the date range).
Is there any way I can step into Print Preview button when clicked to see what's being passed?
Any other ideas?
The issue with the filter not being applied to the report is a known Microsoft issue with certain set ups of Windows 7 and Access 2010. The hotfix found here: http://support.microsoft.com/kb/2596496 solved my problem.
I run Windows 7 64 bit and Office 2010 32 bit, when downloading the hotfix I selected the "x86" platform as that's the 32 bit. If you are using Office 2010 64 bit you should download the "x64" platform.
To find out your office version, open any office product, click File Tab, click Help and it will be on the right under "About Microsoft ".
The only way you can really do that is if your report/query is running some VBA code and put a Stop on the the VBA.
If your query is referencing the fields directly (IMNSHO a bad practice, but I'll work with what we've got) you could change them so they instead reference a VBA function that returns the results of those fields instead. Then you know what it is getting for sure.
There is one more trick that surely worked out for me as a solution, before I came across the accepted answer about hotfix on this thread. Also, because, the hotfix link leads to a valid thread, but there are not downloadable files.
The workaround:
Make a copy of the report file. Use that name in VBA under DoCmd call. Strange how it works, though. Such is the nature of bugs, I guess.

SQL Debug not hitting break point in VS 2012 but does in VS2010

I have an MVC app that I have developed last year using VS 2010 and am able to hit sql trigger break points when opened with VS 2010 but the same app opened in VS 2012 I can't get any break point to work. I'm using SQL Server Object Explorer to set the break points but no luck. What am I missing here?
Microsoft has confirmed that setting a breakpoint does not work in Visual Studio 2012 as it does in 2010. In order to debug my trigger, I had to create a stored procedure that updated the table my trigger belongs to, then in VS 2012 I had to open SQL Server Object Explorer and navigate to the stored procedure, right click on it and select Debug Procedure. Stepping through the procedure took me to the trigger. The tech at Microsoft told me that they were working on making VS 2012 behave the same as 2010 but had no timeframe for completion. It's not that much of a work around, you just have to be aware of how to hit the trigger through a stored procedure.

Right clicking suddenly unbearably slow in VS 2010

I have been using VS2010 without any issues, always on the same application. Suddenly within the last my solution has become unbearably slow when right clicking. When doing other projects, it is fine. The only thing I can think of that I changed was disabling the SQL Server debugging.
It happens if I right click anywhere within the code editor. Everything freezes for about a minute and a half, then the right click menu shows up. If I try again right away, the same thing happens.
Intellisense seems to work fine. It is only the right click.
The project is fairly big, but it has been working fine. I am working on a 2 month old top of the line MacBook Pro (running Windows 7 64 bit in Boot Camp). I did do the patch Tuesday big batch of Microsoft patches in the last 24 hours...
Can anyone suggest where to look?
A delay that long is almost always associated with network time-outs. Use the trouble-shooting strategy demonstrated by Mark Russinovich in this blog post.
Windows 7, x64, 12GB memory, very slow right clicks:
The following steps fixed the problem for me. Right click is now instantaneous. Your Mileage may vary:
I deleted the following directory:
%AppData%Local\Microsoft\VisualStudio\10.0
and reinstalled these three packages from the Visual Studio 2010 Ultimate DVD
Microsoft SQL Server 2008 R2 Data-Tier Application Framework with this command:
\WCU\DAC\DACFramework_enu.msi
Microsoft SQL Server 2008 R2 Data-Tier Application Project:
\WCU\DAC\DACProjectSystemSetup_enu.msi
Microsoft SQL Server 2008 R2 Transact-SQL Language Service:
\WCU\DAC\TSqlLanguageService_enu.msi