VBA for Window Lock and Login time - excel

Is it possible to create a VBA for automatically capturing Windows Lock, I mean Window+L for the particular user logged in in the system and trigger the time and date of locking and logging in back to system in his login.

It is probably possible but certainly useless because VBA can only run when Excel is running which may not always be the case when Windows is. So, to make it useful you should auto-load Excel whenever Windows starts up. That could be done. But you wouldn't be able to force the user to shut down Windows whenever he exits Excel.
The procedure you are thinking of should run on Windows, which means it can't be VBA. VB could do the job or C#.

Related

Excel stops running protected workbook, runs fine if unlocking it

I have a tool, which uses VBA.
As the tool has company secrets, the project is password protected to avoid the info getting into the wrong hands (to some extent). Therefore, as soon as anyone wants to "view code", they have to put in the password.
The tool has a simple GUI, which just loads values from various worksheets and displays them with simple VBA controls.
In some version updates of the tool, excel stops running when trying to load the GUI. No error codes are displayed. In others, work just fine. I don't know what causes this. The updates are simple changes to formulas, updating of price structuring and the like.
If i put in the password before loading the GUI, it works just fine. This, however, is not a good workaround if i want to deploy the tool to anyone who is not authorized to view the internal info.
Any ideas how to debug this issue?
Windows 10 64-bit
Excel 365
Dell Latitude PC

Control Windows Security popup when accessing a website via VBA Excel

Since an Excel file, I would like to connect that intranet of our company. My problem is that the login and the password are to be written in Windows Security popup.
I don't know how to manage that without using SendKeys... Another problem linked to that is that sometimes, the popup appears again, even if the login and password are good. Do youhave an idea to the way to catch such an event?
There is a solution with SendKeys. I lauch a script contained in a VBS file at the beginning of the macro. The script waits for the appearance a the popup and send the login/password in using SendKeys.

Outlook 2013 detected a slow addin

I developed an Addin which consists of Login and the data entry and retrieval functionality. The data entry and retrieval are accessed through REST URL's. The Outlook Startup doesnt has any code, except it checks the outlook version. I implement a plain form which show the user "loading message" initially and the rest of the logic will be handled by a thread. So i hope everything is followed according to the performance, but still i am receiving an addon error as "Outlook Detected an Addin Problem" The Add-in caused outlook to start slowly. I am able to overcome this problem and more and more i am able to get the time statistics for application start or shutdown events. couldany help me how do i resolve this?
Are you trying your AddIn in a debug mode or through an installer ?
First of all, make sure that it has been disabled because it is slow and not because it has errors.
If it has errors, it will cause Outlook to work slowly or even crash.
If it just working slowly, you can try to optimize your AddIn, go through your code again and see what you can do again in a less performance consuming way.
One other thing you can do is, when you will create a setup project for your AddIn to run an installer (instead of debug), you can set your Load Behavior to 16 in the registry.
This will cause the AddIn to load at Outlook startup on the first time after installation and to load on demand the other times. (Load on demand means when the user clicks on the AddIn icon).
This way, your AddIn won't slow Outlook down, except for the first time.

How to identify which application is used to start excel process in task manager

My vb application is used to generate the excel reports.During the last run it got failed in between but the excel process still running in the background on server.
The problem is there are some other applications that uses excel process to generate reports. I need to terminate the particular instance of excel which was still running at the background.
I don't know about the task manager but Sysinternals Process Explorer would give you that information. It lists all processes in a tree view displaying parent/child process hierarchies. http://technet.microsoft.com/en-gb/sysinternals/bb896653.aspx
I asked this question before and the bad news is, that there is no straightforward way to do that.
What can be done: When you start up excel in your application store the PID (if available, I am not sure) and / or the path of the created document. In case of an error, terminate the specific excel process by PID. Or if that is not possible: iterate over all open excel instances and find the one which has opened the path - than kill that instance. The latter approach is problematic in multi user environments, as Excel does not react well when used by multiple applications.
The best way would be to get rid of excel on the server altogether and move to an independent excel-writing library like EPPLUS or Aspose.Cells or other alternatives. But I do not know, if these libraries are still available for VB6. Please note, that Microsoft advises against using Office on a server

Open an Excel file in running instance of Excel with Task Scheduler

I use Task Scheduler to automate a variety of nightly tasks using Excel. Typically the task opens a new instance of Excel, which in turn opens a specified file, which does some stuff and closes itself (and Excel).
Now I have a task that requires an add-in, and use of the add-in requires separate authentication. There is no way to pass my credentials - I have to manually authenticate when the add-in loads. Because the old-fashioned way always launches a new (unauthenticated) instance, I can't figure out how fully automate tasks that require the add-in.
One workaround would be to open an instance of Excel before I leave, authenticate for the add-in, and leave that instance open. Then I could theoretically schedule the opening of some file within that instance (as opposed to launching a new instance to open the file, as described above) and do whatever the tasks were that required the add-in.
Is it possible to do this, either directly by defining the task a certain way, or in a .bat file that I can run on a schedule?
I have a very similar problem and wondering if you have solved this problem through the VBA (getobject(), sendmessage method etc) yet.
I created a seperate question on this just show what I have done. Windows FindWindows and SendMessgae for Auto-authentication excel VBA
Basically I am stuck on how to pass user name and password to the add-in pop up window.
Thanks a million times:)

Resources