excel-vba-mac

How to develop an Excel Macro that contains regular expressions so it will work in Windows and Mac

痞子三分冷 提交于 2019-11-28 09:56:26
I have developed an Excel 2010 VBA Macro that makes use of VBScript.RegExp . One of my users is apparently using Excel Mac 2011, which supports VBA, but no VBScript.RegExp . I have seen several posts that mention it is possible to create your own RegEx functions using AppleScript that could be called by the VBA Macro. However, it seems as though there would have to be a Mac version of the Excel file and a Windows version. This is less than ideal. Is there another way to implement regular expressions in VBA that would be compatible with both Windows and Mac? Unfortunately no solution for this

RegEx with Excel VBA on Mac

天大地大妈咪最大 提交于 2019-11-28 02:19:13
I need to use regEx with Excel VBA. I'm using Mac OS 10.10 and Office 2011. So there is no DLL file I can use. What is there to do here? I read I've to bind an apple script. How is this done and what content does this script need? Natively, you can't really - AppleScript isn't actually that good for this kind of thing (where VBA is concerned) There are other libraries that you can install and use to allow support for things like regular expressions on Mac OS - the one I've seen used the most is Satimage although I've not personally had to use it (yet) so can't vouch for it myself: http://www

Is there a way to create a folder, and sub folders in Excel VBA?

末鹿安然 提交于 2019-11-27 18:33:23
Ok, for those in the know that are masters in Excel VBA, I have a pull down menu of companies that is populated by a list on another tab. Three columns, Company, Job #, and Part Number. What I have going on is that when a job is created I need a folder for said company to be created, and then a sub-folder created based off of said Part Number. So if you go down the path it would look like this: C:\Images\Company Name\Part Number\ Now if either company name or Part number exists don't create, or overwrite the old one. Just go to next step. So if both folders exist nothing happens, if one or

Unable to save as PDF from VBA in mac

橙三吉。 提交于 2019-11-27 08:14:51
问题 I am trying to save a range from a sheet as PDF through VBA. Following is the code that I have written. Sheets("PO Format").PageSetup.PrintArea = "$B$6 : $J$42" Sheets("PO Format").Range("B6:J42").ExportAsFixedFormat Type:=xlTypePDF, Filename:=Sheets("User Settings").Range("B15") & "/" & Sheets("PO Format").Range("F7"), Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True The weird thing is that it is working fine on one system and I able to

Error when closing an opened workbook in VBA Userform

牧云@^-^@ 提交于 2019-11-27 06:55:19
问题 In a subroutine, I want to open a workbook, do some reading from it, and close it. For some reason, I get an error: Run-time error '1004': Method 'Close' of object _Workbook failed I have identified a minimal code snippet to reproduce the problem. Create a fresh excel file. In it, create a Userform. On that, create a Command Button with the following Click event code: Private Sub CommandButton1_Click() Dim filename As String Dim opened_workbook As Workbook filename = Application

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

落花浮王杯 提交于 2019-11-27 04:01:01
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? John Stephens Doing further research, I came across Robert Knight's comment on this question VBA Shell function in Office 2011 for Mac and built an HTTPGet function using his execShell function to call curl. I've tested this on a Mac

How to develop an Excel Macro that contains regular expressions so it will work in Windows and Mac

回眸只為那壹抹淺笑 提交于 2019-11-27 03:19:04
问题 I have developed an Excel 2010 VBA Macro that makes use of VBScript.RegExp . One of my users is apparently using Excel Mac 2011, which supports VBA, but no VBScript.RegExp . I have seen several posts that mention it is possible to create your own RegEx functions using AppleScript that could be called by the VBA Macro. However, it seems as though there would have to be a Mac version of the Excel file and a Windows version. This is less than ideal. Is there another way to implement regular

RegEx with Excel VBA on Mac

99封情书 提交于 2019-11-26 23:40:10
问题 I need to use regEx with Excel VBA. I'm using Mac OS 10.10 and Office 2011. So there is no DLL file I can use. What is there to do here? I read I've to bind an apple script. How is this done and what content does this script need? 回答1: Natively, you can't really - AppleScript isn't actually that good for this kind of thing (where VBA is concerned) There are other libraries that you can install and use to allow support for things like regular expressions on Mac OS - the one I've seen used the

Checking if a worksheet-based checkbox is checked

别来无恙 提交于 2019-11-26 22:52:20
I'm trying to use an IF-clause to determine whether my checkbox, named "Check Box 1", is checked or not, for further use in my program. 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 seem to work, but the debug 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 Selection .Value = xlOn EDIT: If more Information is necessary, My

VBA (Excel) Dictionary on Mac?

拜拜、爱过 提交于 2019-11-26 22:46:09
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 Macs ( my favorite option if one exists ) Do some kind of variable switch like the following: isMac =