Wednesday, December 18, 2024

macro to delete very first sheet of all excel files in a folder

 Sub RenameSheets()
     Dim strFolder As String
     Dim strFile As String
     Dim wbk As Workbook
     Dim i As Long
     With Application.FileDialog(4) ' msoFileDialogFolderPicker
         ' Show dialog
         If .Show Then
             ' Assign selected folder to variable
             strFolder = .SelectedItems(1)
         Else
             Beep
             Exit Sub
         End If
     End With
     ' Append \ if necessary
     If Right(strFolder, 1) <> "\" Then
         strFolder = strFolder & "\"
     End If
     On Error GoTo ErrHandler
     ' Turn off screen updating and event handling
     Application.ScreenUpdating = False
     Application.EnableEvents = False
     ' Get first file name in folder
     strFile = Dir(strFolder & "*.xls*")
     ' Loop
     Do While strFile <> ""
         ' Open workbook
         Set wbk = Workbooks.Open(Filename:=strFolder & strFile)
         ' Loop through sheets except first one
        ' For i = 2 To wbk.Worksheets.Count
            ' With wbk.Worksheets(i)
                 ' Append " Old" to sheet name
             '    .Name = .Name & " Old"
             'End With
         'Next i
         Application.DisplayAlerts = False
         If wbk.Worksheets.Count > 1 Then
         
         wbk.Worksheets(1).Delete
         End If
         
         Application.DisplayAlerts = True
           ' wbk.Close True
         ' Close and save workbook
         wbk.Close SaveChanges:=True
         ' Get next file name
         strFile = Dir
     Loop
ExitHandler:
     ' Turn on screen updating and event handling
     Application.EnableEvents = True
     Application.ScreenUpdating = True
     Exit Sub
ErrHandler:
     MsgBox Err.Description, vbExclamation
     Resume ExitHandler
 End Sub



Thursday, December 12, 2024

turn the pushy_https behaviour on in cpan

 from terminal

type cpan

you get the cpan prompt

then

 o conf init pushy_https

yes


perl tk package install error " expected identifier or '(' before numeric constant" solved on windows 11

when trying

cpan install Tk

I was getting  lot of errors 

the solution is

just install strawberry perl

then from command line

cpanm https://github.com/Lamprecht/perl-tk.git@Strawberry-5.38-patch 


Source:https://stackoverflow.com/questions/78323022/installing-tk-on-strawberry-perl-leads-to-compiler-errors

 

Monday, October 21, 2024

Connect my zeb duke wireless bluetooth headphone using terminal in fedora 40

 install bluez-deprecated 


sudo dnf install bluez-deprecated


hcitool scan


should show the bluetooth devices


if not 


bluetoothctl


agent on
scan on # wait for your device's address to show up here
scan off
trust MAC_ADDRESS (in my case 41:42:FF:71:7A:6B)
pair MAC_ADDRRESS(in my case 41:42:FF:71:7A:6B) 

// the above comment will fail  if the device is already paired
connect MAC_ADDRESS (in my case 41:42:FF:71:7A:6B)


there are simpler ways off course


bluetoothctl devices


this will show the device with the mac address


now if the device is not paired 


bluetoothctl pair 41:42:FF:71:7A:6B


if this succeeds then


bluetoothctl connect 41:42:FF:71:7A:6B


to disconnect



bluetoothctl disconnect 41:42:FF:71:7A:6B

 

 to remove the pairing


bluetoothctl remove 41:42:FF:71:7A:6B






Source:https://unix.stackexchange.com/questions/96693/connect-to-a-bluetooth-device-via-terminal


Source:https://unix.stackexchange.com/questions/96693/connect-to-a-bluetooth-device-via-terminal


Source:https://askubuntu.com/questions/758586/how-to-unpair-bluetooth-device-from-the-command-line


Source:https://www.baeldung.com/linux/bluetooth-via-terminal

Saturday, October 19, 2024

Enable javafx option in eclipse,javafx is not showing solved

 Open eclipse,create a java project,click help,click install new software


in the label beside work with 


paste


https://download.eclipse.org/efxclipse/updates-released/3.9.0/site/


there might open a box 


you have to type there


e(fx)clipse

 

select every component ,install

 

restart eclicpse

 

Source:https://www.youtube.com/watch?v=s3Gz1ivERzY