excel-vba-mac

Excel 2013 VBA Clear All Filters macro

耗尽温柔 提交于 2019-11-26 20:20:32
It seems older macros are not working. I have proper securtiy set to run VBA macros but when I have tried a few methods for clearing ALL filters on a worksheet, I get a compile error. Here is what I have tried: Sub AutoFilter_Remove() 'This macro removes any filtering in order to display all of the data but it does not remove the filter arrows ActiveSheet.ShowAllData End Sub I have buttons on the sheets to clear all filters for ease of use for users since the sheets has a lot of columns that have filters on them. If the sheet already has a filter on it then: Sub Macro1() Cells.AutoFilter End

Dir() function not working in Mac Excel 2011 VBA

拈花ヽ惹草 提交于 2019-11-26 14:40:50
Hi I am trying to list all the files in a subdirectory of where the Excel workbook is residing in. For some reason, the code cannot execute beyond the Dir function. Can anyone please advise? Thank you! Sub ListFiles() ActiveSheet.Name = "temp" Dim MyDir As String 'Declare the variables Dim strPath As String Dim strFile As String Dim r As Long MyDir = ActiveWorkbook.Path 'current path where workbook is strPath = MyDir & ":Current:" 'files within "Current" folder subdir, I am using Mac Excel 2011 'Insert the headers in Columns A, B, and C Cells(1, "A").Value = "FileName" Cells(1, "B").Value =

VBA Shell function in Office 2011 for Mac

假装没事ソ 提交于 2019-11-26 13:45:20
I am trying to launch a shell script from a VBA macro in Word 2011 for Mac that will run in a Terminal window. I have tried using both the Shell function and the MacScript function, but the VBA interpreter doesn't seem to be able to find the script in either case. According to the VBA reference documentation, the following should work: RetVal = Shell("Macintosh HD:Applications:Calculator.app", vbNormalFocus) This produces a run-time error 53 'File not found'. Any suggestions? Robert Knight The Shell() VBA function on Mac appears to require the full path as an HFS-style path (with colons

How can I install/use “Scripting.FileSystemObject” in Excel 2010 for MAC?

感情迁移 提交于 2019-11-26 11:39:12
问题 I am using Excel for Mac 2011 which has VBA version 14.0. I am trying to use this code which accesses the file system , which I know works on Windows: Function qfil_GetDirectory(strDirectoryName As String) Dim objFSO As Variant Dim objDirectory As Variant Set objFSO = CreateObject(\"Scripting.FileSystemObject\") Set objDirectory = objFSO.GetFolder(strDirectoryName) Set qfil_GetDirectory = objDirectory End Function However, when I run it in Excel for Mac 2011, it gives me this error : Run-time

VBA (Excel) Dictionary on Mac?

好久不见. 提交于 2019-11-26 11:18:03
问题 I have an Excel VBA project that makes heavy use of Windows Scripting Dictionary objects. I recently had a user attempt to use it on a Mac and received the following error: Compile Error: Can\'t find project or library Which is the result of using the Tools > References > Microsoft Scripting Runtime library. My question is, is there a way to make this work on a Mac ? The following are the 3 cases I can think of as being possible solutions: Use a Mac plugin that enables use of Dictionaries on

How do I issue an HTTP GET from Excel VBA for Mac

丶灬走出姿态 提交于 2019-11-26 10:59:30
问题 I need to issue an HTTP Get with a query string to a web service from Excel for Mac 2011. I\'ve seen the answers for using QueryTables (How can I send an HTTP POST request to a server from Excel using VBA?) but they use the POST method, not a GET method. I also see that it\'s easy from a Windows machine, but I\'m stuck on a Mac. Any suggestions, or is it hopeless? 回答1: Doing further research, I came across Robert Knight's comment on this question VBA Shell function in Office 2011 for Mac and

Checking if a worksheet-based checkbox is checked

 ̄綄美尐妖づ 提交于 2019-11-26 09:10:54
问题 I\'m trying to use an IF-clause to determine whether my checkbox, named \"Check Box 1\", is checked. My current code: Sub Button167_Click() If ActiveSheet.Shapes(\"Check Box 1\") = True Then Range(\"Y12\").Value = 1 Else Range(\"Y12\").Value = 0 End If End Sub This doesn\'t work. The debugger is telling me there is a problem with the ActiveSheet.Shapes(\"Check Box 1\") However, I know this code works (even though it serves a different purpose): ActiveSheet.Shapes(\"Check Box 1\").Select With

Dir() function not working in Mac Excel 2011 VBA

血红的双手。 提交于 2019-11-26 03:58:39
问题 Hi I am trying to list all the files in a subdirectory of where the Excel workbook is residing in. For some reason, the code cannot execute beyond the Dir function. Can anyone please advise? Thank you! Sub ListFiles() ActiveSheet.Name = \"temp\" Dim MyDir As String \'Declare the variables Dim strPath As String Dim strFile As String Dim r As Long MyDir = ActiveWorkbook.Path \'current path where workbook is strPath = MyDir & \":Current:\" \'files within \"Current\" folder subdir, I am using Mac