I am absolutely new to VBA. I am trying to create a presentation such that content of each cell (in a row) creates a new slide in the presentation. I searched for the code, but I could only find it for Windows. When I am trying to use the code on Mac - OS X 10.7.4 (Excel 2011), I am getting an error. Code and error are as follows: Code: converted to text: Sub OneSlideForEachRowCell() 'Open the Excel workbook. Change the filename here. ![]() Compatible with Excel 98 through Excel 2004 for Mac and Excel 97 through Excel 2003 for Windows. Saves settings such as formatting, headings, formulas, VBA macros, and custom toolbars. VBA macros do not run in Excel 2008. Mac os x flv player vlc. Dim OWB As New Excel.Workbook Set OWB = Excel.Application.Workbooks.Open{':Users:vikshek:Desktop:list.xlsx') 'Grab the first Worksheet in the Workbook Dim WS As Excel.Worksheet Set WS = OWB.Worksheets(1) 'Loop through each used row in Column A For i = 1 To WS.Range('A65536').End(xlUp).Row 'Copy the first slide and paste at the end of the presentation ActivePresentation.Slides(1).Copy ActivePresentation.Slides.Paste(ActivePresentation.Slides.Count + 1) 'Change the text of the first text box on the slide. ActivePresentation.Slides(ActivePresentation.Slides.Count).Shapes(1).TextFrame.TextRange.Text = WS.Cells(i, 1).Value Next End Sub Error: Run-time error '429': ActiveX component can't create object On debugging, it's highlighting the text Set OWB = Excel.Application.Workbooks.Open(Filename:=':Users:vikshek:Desktop:list.xlsx').
0 Комментарии
Оставить ответ. |
АвторНапишите что-нибудь о себе. Не надо ничего особенного, просто общие данные. Архивы
Март 2019
Категории |