Solved

Excel VBA - Workbook Connection invlid in function

Posted on 2015-02-13
2
105 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
Simon earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

628 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