Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel VBA - Workbook Connection invlid in function

Posted on 2015-02-13
2
Medium Priority
?
107 Views
Last Modified: 2016-02-10
Attached is a workbook I am creating.  I have two functions called within the Macro GoBtn:  fn_pcp and fn_ip.

The first function works without a problem.  The fn_ip gives me an error that the ocn is invalid.

the two functions are essentially the same except for the connection name and the stored procedures being called by the connection.

I have checked that the connection name exists, "CPOEPhysInpatients"  It does.
I checked that the stored procedure being called in the command text exists, GetCPOEPhysDatasummary_Inpatient.  It does.

Can you review the vba code and let me know where the error is?

Thank you

Glen
CPOE-Report-Card-Summary-Executive.xlsm
0
Comment
Question by:GPSPOW
2 Comments
 
LVL 18

Accepted Solution

by:
Simon earned 1500 total points
ID: 40609508
Your VBA code looks fine. I would suggest looking more carefully at the properties of the two connections.
Can you post a screenshot of the error dialog or the exact text from it?
0
 

Author Closing Comment

by:GPSPOW
ID: 40611151
I reworked the macros and vba and eliminated the functions.

There were no errors with the connections.

Sometimes the communication between my remote laptop and the server can get frustrating.

thanks

Glen
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
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.

972 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