Example: /XL/List Hyperlinks

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/XL/List Hyperlinks


Required plugins for this example: MBS XL Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /XL/List Hyperlinks

This example is the version from Sun, 20th Jan 2018.

Project "List Hyperlinks.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() RegisterLibXL // select a file and open it dim book as XLBookMBS dim tab as string = encodings.ASCII.Chr(9) dim file as FolderItem = GetOpenFolderItem(FileTypes1.All) if file = nil then quit if right(file.Name,4) = ".xls" then book = new XLBookMBS(false) elseif Right(file.Name,5)=".xlsx" then book = new XLBookMBS(true) else MsgBox "Unknown file extension!" quit end if // Warning: Without a license the plugin will read only 100 cells (first row is unavailable) // book.SetKey("...", "...") if book.Load(file) then // now write all values from all sheets to text file dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt") dim t as TextOutputStream = f.CreateTextFile for each sheet as XLSheetMBS in book.Sheets t.WriteUTF8 "Sheet: "+sheet.Name t.WriteLine dim u as integer = sheet.HyperlinkSize-1 for i as integer = 0 to u dim rowFirst as integer, rowLast as integer, colFirst as integer, colLast as integer dim URL as string = sheet.Hyperlink(0, rowFirst, rowLast, colFirst, colLast) t.WriteLine URL t.WriteLine str(rowFirst)+":"+str(colFirst)+" to "+str(rowLast)+":"+str(colLast) t.WriteLine next next t.Close f.Launch else MsgBox book.ErrorMessage end if quit End EventHandler
Sub RegisterLibXL() // once you bought a LibXL license, you can put your license key here // see order links on our website // http://www.monkeybreadsoftware.de/xojo/plugin-xls.shtml #if TargetMacOS then XLBookMBS.SetKeyGlobal "your name", "your Mac LibXL license key" #elseif TargetWin32 then XLBookMBS.SetKeyGlobal "your name", "your Windows LibXL license key" #elseif TargetLinux then XLBookMBS.SetKeyGlobal "your name", "your Linux LibXL license key" #endif End Sub
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
FileTypes1
Filetype application/vnd.ms-excel
Filetype excel
Filetype excel xml
End FileTypes1
Module Module1
Sub WriteUTF8(extends t as TextOutputStream, s as string) t.Write ConvertEncoding(s, encodings.UTF8) End Sub
End Module
End Project

The items on this page are in the following plugins: MBS XL Plugin.


💬 Ask a question or report a problem