Solved

Enable Data Connections in Excel 2011 for mac

Posted on 2011-03-03
7
3,037 Views
Last Modified: 2012-05-11
I have a couple of macros that I originally set up in Excel 2007 for PC that pull data from a web query and use Application.OnTime in a Workbook_Open event to refresh and save at a certain time automatically every night (it uses task scheduler to automatically open Excel daily).  I'm trying to accomplish this in 2011 for mac and am being thwarted by the need to re-enable data connections every time the workbook opens.  

I've tried recording a macro while the "enable content" security warning that pops up when you open the workbook is still active, but nothing records.  I can't find any settings to permanently enable web queries.

Is there a way to permanently enable the content?  A way to write the re-enabling into a macro?

Any help would be much appreciated!
0
Comment
Question by:kwazi5
  • 3
  • 2
7 Comments
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35033969
>>A way to write the re-enabling into a macro?

I am not 100% sure but check the Workbook.EnableConnections Method for enabling the connection.

Sid
0
 

Author Comment

by:kwazi5
ID: 35034118
I'm not entirely sure I've done this right, but I got the error below.


my code:
In ThisWorkbook:

Private Sub Workbook_Open()

Run "EnableWorkbookConnections"

End Sub




In a module, I have:


Sub EnableWorkbookConnections()

ThisWorkbook.EnableConnections

End Sub


And I get:

Compile Error:

Method or data member not found
0
 
LVL 6

Expert Comment

by:TinTombStone
ID: 35034403
Try it like this

This is assuming that VBA works the same on a Mac

Private Sub Workbook_Open()

        EnableWorkbookConnections

End Sub

Sub EnableWorkbookConnections()

        ThisWorkbook.EnableConnections

End Sub
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:kwazi5
ID: 35106209
Sorry for the delayed response.  Just got a chance to work on this again tonight.


TinTombStone - I tried your suggestion and received the same compile error when it reached .EnableConnections.  I'm guessing this means the function is not available in this version of excel?

Again, apologies for the delay.
0
 

Author Comment

by:kwazi5
ID: 35318247
It would be nice if someone could confirm that Excel 2011 for mac does not allow you to enable data connections via code.  I've found no way to enable connections other than to click on the button that pops up upon opening a book with an established data connection.
0
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 500 total points
ID: 35320393
If my understanding is correct, then at the moment it seems like you cannot do that.

Please see this link

Title: Import data from a database
Link: http://mac2.microsoft.com/help/office/14/en-us/excel/item/a88d05c8-d77e-49f9-baf2-5e3d96122a34

Sid
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now