Today we are providing best free color tools for designers. Color is main section of web design, it describes the whole nature of websites. Visit this list and select the best color for your websites.
Categories
- All Posts
- android
- AntiVirus
- apps
- AWS
- Backup
- Batch
- Blogger
- Books
- CISCO
- Cloud
- Cluster
- Coin Master
- commands
- Commvault
- Configurations
- CSS
- Data Protector
- Data Recovery
- DB Backup
- Desktop Sharing
- Disabling
- domain
- Downloads
- Dumps
- ESX
- exam questions
- Excel
- Exchange
- FOLDER LOCK
- free Books
- games
- Guide
- Hacks
- HP - UX
- HP0-A113
- HP0-A113 HP ATP - Data Protector v9 (Exam 1 Questions) - Question 9
- HTML
- Hyper-V
- information
- Internet
- interview questions
- inventory
- jQuery
- key
- Links
- Linux or Unix
- Mcafee
- microsoft
- Migrations
- mobile tips
- NetBackup
- Networker
- Networking
- Online Database
- Operating system
- Outlook
- Password reset
- PHP
- Ports
- RAID
- regedit-tips
- Registry
- SAN
- SBS 2008
- Simulator
- software
- SQL
- Storage
- Study Meterial
- tech support
- Tools
- Top List
- Troble Shooting
- Useful commands
- vbscript
- Veeam
- Videos
- Virtual Machine
- VirtualBox
- VMWare
- VSphere
- webinar
- windows
- windows 10
- Windows 2003
- Windows 2008
- Windows 7
- Windows 8
- Windows Tips
- windows XP
- YouTube
Contact
Showing posts with label vbscript. Show all posts
Showing posts with label vbscript. Show all posts
Wednesday, April 29, 2015
Monday, July 4, 2011
Password-Protect an Excel Spreadsheet
Adds a password (%reTG54w) to a Microsoft Excel spreadsheet.
PowerShell
$comments = @' Script name: Set-ExcelPassword.ps1 Created on: Friday, June 29, 2007 Author: Kent Finkle Purpose: How can I use Windows Powershell to Password-Protect an Excel Spreadsheet? '@ #----------------------------------------------------- function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject( [System.__ComObject]$ref) -gt 0) [System.GC]::Collect() [System.GC]::WaitForPendingFinalizers() } #----------------------------------------------------- $xlNormal = -4143 $xl = new-object -comobject excel.application $xl.Visible = $True $xl.DisplayAlerts = $False $wb = $xl.Workbooks.Add() $ws = $wb.Worksheets.Item(1) $ws.Cells.Item(1, 1).Value() = get-date $a = $wb.SaveAs("C:\Scripts\Test.xls",$xlNormal,"%reTG54w") $a = $xl.Quit() $a = Release-Ref($ws) $a = Release-Ref($wb) $a = Release-Ref($xl)
| Windows Server 2008 R2 | No |
| Windows Server 2008 | No |
| Windows Server 2003 | No |
| Windows 7 | No |
| Windows Vista | No |
| Windows XP | No |
| Windows 2000 | No |
This script is tested on these platforms by the author. It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know.
Deletes every other row in a Microsoft Excel worksheet.
Deletes every other row in a Microsoft Excel worksheet.
PowerShell
$comments = @' Script name: Delete-EveryOtherRow.ps1 Created on: Sunday, September 02, 2007 Author: Kent Finkle Purpose: How can I use Windows Powershell to delete every other row on an Excel worksheet? #http://support.microsoft.com/kb/213610/en-us '@ #----------------------------------------------------- function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject( [System.__ComObject]$ref) -gt 0) [System.GC]::Collect() [System.GC]::WaitForPendingFinalizers() } #----------------------------------------------------- $xl = new-object -comobject excel.application $xl.Visible = $True $wb = $xl.Workbooks.Add() $ws = $wb.Worksheets.Item("Sheet1") $2d = new-object 'object[,]' 20,1 # Fill an array so we can put the numbers into Excel all at once. for ($i=0; $i -le 19; $i++) { $2d[$i,0] = $i + 1 } $r = $ws.Range("A1:A20") # Put the array into the sheet so we have something to work with. $r.Value() = $2d $y = $false # Change this to $True if you want to # delete rows 1, 3, 5, and so on. $i = 1 $r = $ws.UsedRange $cnt = $r.rows.Count # Loop once for every row in the selection. for ($x=1; $x -le $cnt; $x++) { if ($y -eq $true) { # ...delete an entire row of cells. $a = $r.Cells.Item($i).EntireRow.Delete() } Else { # ...increment $i by one so we can cycle through range. $i++ } # If ($y is true, make it false; if $y is false, make it true.) $y = -not($y) } $a = Release-Ref($r) $a = Release-Ref($ws) $a = Release-Ref($wb) $a = Release-Ref($xl)
| Windows Server 2008 R2 | No |
| Windows Server 2008 | No |
| Windows Server 2003 | No |
| Windows 7 | No |
| Windows Vista | No |
| Windows XP | No |
| Windows 2000 | No |
This script is tested on these platforms by the author. It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know.
Import a Large Text File
Imports a text file into Excel even if the number of lines in that file exceeds Excel's total number of rows limitation.
Visual Basic
' This script was written for folks trying to import a text file into ' Excel 2003 that exceed the row limitations. ' This version works on Windows XP and has not been tested on any other OS. Const ForReading = 1 Const ForAppending = 2 Set objDialog = CreateObject("UserAccounts.CommonDialog") objDialog.Filter = "All Files|*.*" objDialog.InitialDir = "C:\" intResult = objDialog.ShowOpen If intResult = 0 Then Wscript.Quit Else BreakFile = objDialog.FileName End If Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(BreakFile, ForReading) FiletoSplit = objFSO.GetFileName(BreakFile) FolderDest = Mid(objFSO.GetAbsolutePathName(BreakFile),1, _ Len(objFSO.GetAbsolutePathName(BreakFile))-(Len(FiletoSplit))) FileSplitName = objFSO.GetBaseName(BreakFile) dtmStart = Now() strContents = objFile.ReadAll FileNum = 1 fname = FolderDest & FileSplitName & "Split_" & FileNum & ".txt" Set objFile1 = objFSO.OpenTextFile(fname, ForAppending, True) CountLines = 0 arrLines = Split(strContents, vbCrLf) If ubound(arrLines) < 64500 Then msgbox "This file will fit into Excel already. No split is necessary.",48,"SplitFile" Wscript.Quit End If HeaderText = arrLines(0) For i = 0 to ubound(arrlines) strLine = arrLines(i) & vbCrLf objFile1.Write strLine If (Countlines) < 64500 Then countlines = countlines + 1 ElseIf Countlines >= 64500 Then objFile1.Close Countlines = 0 FileNum = FileNum + 1 fname = FolderDest & FileSplitName & "Split_" & FileNum & ".txt" Set objFile1 = objFSO.OpenTextFile(fname, ForAppending, True) objFile1.Write HeaderText & vbCrLf End If Next objFile.Close dtmEnd = Now() If MsgBox("There were " & FileNum & " files created." & vbcrlf & _ "The files were put into this folder: " & FolderDest & _ vbCrLf & "The script took " & DateDiff("s", dtmStart, dtmEnd) & " seconds " & _ "to break the " & FiletoSplit & " file." & vbcrlf & vbcrLF & _ "Click OK to open destination folder or CANCEL to quit.", _ 1,"SplitFile") = vbOK Then Set objShell = CreateObject("Shell.Application") strPath = FolderDest objShell.Explore strPath End If
Verified on the following platforms
| Windows Server 2008 R2 | No |
| Windows Server 2008 | No |
| Windows Server 2003 | No |
| Windows 7 | No |
| Windows Vista | No |
| Windows XP | No |
| Windows 2000 | No |
This script is tested on these platforms by the author. It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know.
Copy Data From One Spreadsheet to Another
Copies data from one Excel spreadsheet to another.
PowerShell
$comments = @' Script name: Copy-ExcelData.ps1 Created on: Wednesday, August 22, 2007 Author: Kent Finkle Purpose: How can I use Windows Powershell to Copy Data From One Spreadsheet to Another? '@ # ----------------------------------------------------- function Release-Ref ($ref) { ([System.Runtime.InteropServices.Marshal]::ReleaseComObject( [System.__ComObject]$ref) -gt 0) [System.GC]::Collect() [System.GC]::WaitForPendingFinalizers() } # ----------------------------------------------------- $xl = new-object -comobject excel.application $xl.Visible = $True $wb = $xl.Workbooks.Add() $ws = $wb.Worksheets.Item("Sheet1") $2d = new-object 'object[,]' 20,1 for ($i = 0; $i -le 19; $i++) { for ($j = 0; $j -le 0; $j++) { $2d[$i,$j] = $i } } $r = $ws.Range("A1:A20") $r.Value() = $2d $a = $r.Copy() $xl2 = new-object -comobject excel.application $xl2.Visible = $True $wb2 = $xl2.Workbooks.Add() $ws2 = $wb2.Worksheets.Item("Sheet1") $a = $ws2.Paste() $a = Release-Ref($ws2) $a = Release-Ref($wb2) $a = Release-Ref($xl2) $a = Release-Ref($ws) $a = Release-Ref($wb) $a = Release-Ref($xl)
| Windows Server 2008 R2 | No |
| Windows Server 2008 | No |
| Windows Server 2003 | No |
| Windows 7 | No |
| Windows Vista | No |
| Windows XP | No |
| Windows 2000 | No |
This script is tested on these platforms by the author. It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know.
Subscribe to:
Comments (Atom)
Upcoming Topics
Search This Blog
Subscribe via email
Weekly
-
Based on my experience in the daily issues level I have shorted few must know backup failure issues status codes which I have mentioned here...
-
Users of Packet Tracer 3.2, 4.0 and 5.0 will note a variety of new features in Packet Tracer 5.2. Protocol Improvements Packet Tracer...
-
Today i'm going to explain how to configure your VMware integration or backup policy in Veritas Netbackup in a simple and straight way...
-
Veeam is a software company that provides data backup, disaster recovery and virtualization management solutions. Veeam’s products are use...
-
WaveMaker is a visual development tool that lets everyone quickly build and deploy great-looking web and cloud applications. With WaveMaker...
-
The DNS protocol has been around for decades and is a stable and reliable protocol. Even so, DNS does occasionally have problems. PING is a ...
-
Q-4 : Which method should you use to export a Data Protector client from the cell? A . The internal database context of the Data Prote...
-
MicroFocus Data Protector (HPDP) - Most asked interview questions Hi Friends, hope you are enjoying with my other posts that I shared s...
-
Summary : This step-by-step article describes how to determine whether users changed their passwords before an account lockout. You may want...
-
QUESTION NO: 10 Before launching a Data Protector Cell Manager installation on Windows, which requirements should you ensure are met? (...
