Senin, 26 Oktober 2009

Open Visual Basic Editor in Office 2007

Access

1. On the Database Tools tab, in the Macro group, click Visual Basic.
2. In the Visual Basic Editor, on the Help menu, click Microsoft Visual Basic Help.
3. In the Help window, click Access VBA Reference.
4. In the Type words to search for box, type the method, property, function,
statement, or object for which you want help, or type a query.

Excel

1. On the Developer tab, click Visual Basic.
I don't see the Developer tab :
1. Click the Microsoft Office ButtonButton image, and then click Excel Options.
2. Click Popular, and then select the Show Developer tab in the Ribbon check box.
2. On the Help menu, click Microsoft Visual Basic Help.
3. In the Type words to search for box, type the method, property, function,
statement, or object for which you want help, or type a query.

Rabu, 07 Oktober 2009

Schedule a reboot in Windows 2003

There is always one application…yes one application that you use all the time, and can’t afford to have it down for one minute during the day.

This same application is buggy and always has problems if it keeps running day after day. You need to reboot once in a while. Yes, and this means you need to stay late and wait until everyone leaves…and then reboot.

There is a simple solution to the problem…the shutdown command in windows 2003. It can shutdown or reboot your system from the command line, and will even allow you to specify reason codes for the shutdown. Here is the lowdown on its possible options:

Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]

No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote co
mputer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c “comment” Shutdown comment (maximum of 12
7 characters)
-f Forces running applications to close without warning
-d [u][p]:xx:yy The reason code for the shutdown
u is the user c
ode
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer
less than 65536)


So, if I wanted to shutdown the machine at a specified time I could create a script with the following:

shutdown -r -f -c “Shutdown to refresh buggy program”

The -f makes sure no application can keep the shutdown from happening, and the -c allows me to add a comment in the event log. The -r tells it to reboot.

Now I have saved this as RebootDaily.bat (Under the windows folder)

Lets schedule it to run daily at 3am. Open the control panel and double click on the “Scheduled Tasks”, and browse for the batch file that we just saved.

Click next, and set the time you want the reboot to start. If you have any backup jobs I would make sure the job time is far from your reboot.






Click next and set the user account that will be used for the reboot. I suggest setting up a separate account with specific permissions for this task. That way you can slightly relax your password change policy – and lock it down so it can’t do much but reboot the system. Otherwise you will need to make sure you update this task each time the administrator password is changed.



Click next, and then finish. Your reboot has been scheduled. Just makes sure it works by manually running it once.

Now your buggy application can get a fresh start every day.

How to Post a YouTube Video on Facebook

You can share your favorite Youtube video with your friends on Facebook by doing these simple steps.

  1. Login into Facebook.
  2. On your wall next to the "update status" button, click on the "share link" tab.
  3. Copy and paste the URL of the Youtube video you want to share into the field under "share link".
  4. Click "Preview".
  5. Facebook will figure out that you're posting a Youtube video and will grab the screenshot and required information to embed it on your posting.
  6. Enter in an optional summary and click "Post".
  • NOTE: You must have the "Posted Items" Facebook application added to your account for this to work.