hasrocks.blogg.se

Get hard drive serial number vba
Get hard drive serial number vba












This will be much faster than reinstalling Excel, but you will still need to grab your Office product CDs in order to complete the installation. The final solution is to run the Office Setup program and reinstall just the Analysis ToolPak. (You do make backups, don't you?) If the files are there, you can move them to your system and the ToolPak should again be available. If that doesn't work, then check the backups of your hard drive. If either the files or folder is there, undelete them and you should be fine. You should also check to see if the actual folder for the Analysis ToolPak is in the Recycle Bin. If the files are not in that folder, then check your Recycle Bin to see if they are still there. The above example is for a default installation of Office 2010. The path can vary, of course, depending on how Office was installed on your system and which version of Office you are using. Normally they reside in a folder similar to the following:Ĭ:\Program Files\Microsoft Office\OFFICE14\Library\Analysis\ These two files are, respectively, the add-in and the VBA help file for the add-in. The Analysis ToolPak uses two files, named FUNCRES.XLAM and ATPVBAEN.XLAM. She was wondering how she can restore it, short of reinstalling Excel. StrPATH = Left(App.Path, InStr((InStr(3, App.Path, "\") + 1), App.Jerice was cleaning out files on her computer and thinks she may have trashed the Analysis ToolPak add-in by mistake. 'checking whether the drive is local or mapped The following sample provides serial of the drive where your EXE is 'APi declarationĭeclare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long SDrive, vbNullString, 0, GetSerialNumber, _ĭrive = InputBox("Enter drive for checking SN") Sub ShowDriveInfo (drvpath) Dim fs, d, s, t Set fs CreateObject ('Scripting.FileSystemObject') Set d fs.GetDrive (fs.GetDriveName (fs.GetAbsolutePathName (drvpath))) Select Case d.DriveType Case 0: t 'Unknown' Case 1: t 'Removable' Case 2: t 'Fixed' Case 3: t 'Network' Case 4: t 'CD-ROM' Case 5: t 'RAM Disk' End Select s 'Drive ' & d.DriveLetter & ': - ' & t s s & vbCrLf & 'SN: ' & d.SerialNumber. Lib "kernel32" Alias "GetVolumeInformationA" _īyVal lpFileSystemNameBuffer As String, _īyVal nFileSystemNameSize As Long) As Long The following code illustrates the use of the SerialNumber property. Private Declare Function GetVolumeInformation _














Get hard drive serial number vba