excel-vba-mac

Date for VBA not working in Excel 2011?

余生颓废 提交于 2019-12-02 03:51:13
Here is my code, I am attempting, which works BTW on a PC, but not on a Mac, to run this code and have an excel sheet created, named, add a tab, change the color of said tabs, change the name of said tabs, and then transpose the data while maintaining the format of the cells and width and height of the cells to the new worksheet. This works, on a PC.... but when I get onto a Mac, it doesn't. I go into References, and this is what I see. I see Ref Edit Control, and Microsoft Scripting Runtime are missing. I disabled both, and the script gives me an error here still: wbBK2.SaveAs Dir &

Refresh QueryTable throwing “General ODBC error” - VBA Excel 2011 for Mac

匆匆过客 提交于 2019-12-01 15:05:55
问题 EDIT: New mistake found? I may have just found out why my script wouldn't work anymore. There has been an office update recently and it seems they have implemented the microsoft query which gets rid of the ODBC-Manager which I installed and configured to my needs. Now the actual problem may be that this microsoft query doesn't have the UNICODE-library and I don't know where I could put them so that the microsoft query would read/get them. Or rather I don't know how to give the microsoft query

VBA code to fetch data from Mysql DB in Mac Excel 2011

让人想犯罪 __ 提交于 2019-12-01 08:33:52
I was using ADODB code in Windows to fetch data from Mysql Database and it was working fine. However, I can not seem to get my Excel workbook (using ADODB) to work with Excel Mac 2011. After a lot of googling, I found an ODBC connector from Actual tech and I was able to fetch three rows using Microsoft Query. But I want this to be done using VBA code but have been unable to do so. Has anyone gotten this to work? If yes, can you please provide me with a sample code. Thanks in Advance !! P.S: I know there is a similar existing question but the link provided in the answer is no longer working.

VBA code to fetch data from Mysql DB in Mac Excel 2011

喜你入骨 提交于 2019-12-01 06:47:25
问题 I was using ADODB code in Windows to fetch data from Mysql Database and it was working fine. However, I can not seem to get my Excel workbook (using ADODB) to work with Excel Mac 2011. After a lot of googling, I found an ODBC connector from Actual tech and I was able to fetch three rows using Microsoft Query. But I want this to be done using VBA code but have been unable to do so. Has anyone gotten this to work? If yes, can you please provide me with a sample code. Thanks in Advance !! P.S: I

Save embedded Word Doc as PDF

强颜欢笑 提交于 2019-11-30 19:27:47
SCENARIO A word document is embedded in Excel 2011 file. I need to save it as a pdf. Had it been Excel 2010 then it wouldn't have been a problem as MS-Office in Win Pcs support OLE automation. WHAT HAVE I TRIED? This is the code that I tried in Excel 2010 which works. Option Explicit Sub Sample() Application.ScreenUpdating = False Dim shp As Shape Dim objWord As Object Dim objOLE As OLEObject Set shp = Sheets("Sheet1").Shapes("Object 1") shp.OLEFormat.Activate Set objOLE = shp.OLEFormat.Object Set objWord = objOLE.Object objWord.ExportAsFixedFormat OutputFileName:= _ "C:\Users\Siddharth Rout

Save embedded Word Doc as PDF

◇◆丶佛笑我妖孽 提交于 2019-11-30 03:12:53
问题 SCENARIO A word document is embedded in Excel 2011 file. I need to save it as a pdf. Had it been Excel 2010 then it wouldn't have been a problem as MS-Office in Win Pcs support OLE automation. WHAT HAVE I TRIED? This is the code that I tried in Excel 2010 which works. Option Explicit Sub Sample() Application.ScreenUpdating = False Dim shp As Shape Dim objWord As Object Dim objOLE As OLEObject Set shp = Sheets("Sheet1").Shapes("Object 1") shp.OLEFormat.Activate Set objOLE = shp.OLEFormat

Excel Macro Multiple Sheets to CSV

不羁的心 提交于 2019-11-29 17:29:05
I have a macro that I am running in Excel to separate 49 sheets into individual CSV files. However, it is getting caught up on line 7 Application.ActiveWorkbook.SaveAs Filename: = xcsvFile, _ FileFormat: = xlCSV, CreateBackup: = False Here's the surrounding code: Sub ExportSheetsToCSV() Dim xWs As Worksheet For Each xWs In Application.ActiveWorkbook.Worksheets xWs.Copy Dim xcsvFile As String xcsvFile = CurDir & "\" & xWs.Name & ".csv" Application.ActiveWorkbook.SaveAs Filename: = xcsvFile, _ FileFormat: = xlCSV, CreateBackup: = False Application.ActiveWorkbook.Saved = True Application

Unable to save as PDF from VBA in mac

て烟熏妆下的殇ゞ 提交于 2019-11-28 14:10:53
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 save it at the mentioned path and then also send out a mail, but while testing it on another system I

Is there a way to get ADODB to work with Excel for Mac 2011?

两盒软妹~` 提交于 2019-11-28 13:37:48
I can not seem to get my Excel workbook (using ADODB) to work with Excel Mac 2011. I am using ADODB code. Are there add-ins available? Even from a third-party? Has anyone gotten this to work? Are there add-ins available? Even from a third-party? Hope these download links helps? ODBC drivers that are compatible with Excel for Mac Quoted from the MSKB in case the link dies ODBC drivers that are compatible with Excel for Mac If you want to import data into Excel for Mac from a database, you need an Open Database Connectivity (ODBC) driver installed on your Mac. The driver you get depends on which

Excel Macro Multiple Sheets to CSV

无人久伴 提交于 2019-11-28 12:38:29
问题 I have a macro that I am running in Excel to separate 49 sheets into individual CSV files. However, it is getting caught up on line 7 Application.ActiveWorkbook.SaveAs Filename: = xcsvFile, _ FileFormat: = xlCSV, CreateBackup: = False Here's the surrounding code: Sub ExportSheetsToCSV() Dim xWs As Worksheet For Each xWs In Application.ActiveWorkbook.Worksheets xWs.Copy Dim xcsvFile As String xcsvFile = CurDir & "\" & xWs.Name & ".csv" Application.ActiveWorkbook.SaveAs Filename: = xcsvFile, _