I do my VBA Dev in Excel, but want to provide the same features to LibreOffice users of the game tools I am writing.
Things seemed to work fine, but then I keep hitting issues.
Reading here I see all sorts of advice, but cannot make use of it because I do not understand it.
I see I probably should include :
Option VBASupport 1
But that it has to be before executable code. I try and find how to do this… and cannot … but then the next run fails on that very line, expecting a sub? Even though I am sure I did not add the line between finding I need it, and it failing…
The following code is in a module… and is called from Excel when it starts up.
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
’
’ OnStartUp
’ This Sub sets game specific stuff related to the Tool WB, and is called at start of every process
Public Sub OnStartUp()
Dim cOpSys As String, nRow As Long, nOK As Long, cData As String
Call HideUpdates
If pcSlash = “” Then
Set pbTool = ActiveWorkbook
Set psTool = pbTool.Sheets(“Tool”)
psTool.Visible = True
Call HideTabs
cOpSys = Application.OperatingSystem
If InStr(1, cOpSys, "Windows") > 0 Then
pcSlash = "\"
ElseIf InStr(1, cOpSys, "Mac") > 0 Then
pcSlash = "/"
ElseIf InStr(1, cOpSys, "Linux") + InStr(1, cOpSys, "Unix") > 0 Then
pcSlash = "/"
Else
Msg ("Unknown Operating System:" & cOpSys)
pcSlash = "\"
End If
pcCurDrive = ActiveWorkbook.Path & pcSlash
This seems to work initially… but then I get errors on various lines. Even the line starting REM and the first starting '. I think the REM line was added by VBA/Excel …but I no longer have any confidence in that.
Hideupdates seemed to work… it is a Sub that I have now had to comment out all the lines because Application. anything seems not to work.
Public Sub HideUpdates()
’ Application.ScreenUpdating = False
’ Application.EnableEvents = False
’ Application.AskToUpdateLinks = False
’ Application.DisplayAlerts = False
’ Application.Calculation = pxlManual
’ Application.StatusBar = True
plAutoPhase = True
End Sub
Many of the answers in other posts assume some knowledge i do not have. I know this is a long question… but… help! please!
)
