I have a macro calling:
strMyName = Macros("MyMacro.svb").Path
Since I migrated from Vista to Win7, this call generate an Exception 80004005
This not the case, when I change the user Folder settings to 'display' the file extension.
Unfortunately, my users works on standard configuration, and this workaround can't be used.
Do you have an other idea of workaround? Is it a bug in the standard libraries?
(using Statistica version 10)
Actually, the bug is that your method of referencing the macro works at all. The Macros collection uses the .Item property to refer to individual macros within this collection, and the .Item property is an integer value. Here’s a workaround that should permit you to extract the path property from the desired macro, regardless of whether or not the user has elected to display file extensions:
Dim strMyName As String
Const MACRO_NAME As String = " MyMacro"
Dim q As Long
For q = 1 To Macros.Count
If InStr(1, Macros.Item(q).Name, MACRO_NAME) > 0 Then strMyName = Macros.Item(q).Path
I do hope that you find this solution satisfactory.