If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > How to surpress OLEDB error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-05, 07:55
blom0344 blom0344 is offline
Registered User
 
Join Date: Jan 2003
Location: Zutphen,Netherlands
Posts: 256
How to surpress OLEDB error

I currently use VBA to refresh OLAP data from an offline cube. The initial connection has been done with MS query.
When refreshing I keep running into a pop-up that says 'cannot connect to datasource' (for every refreshed pivottable)
Is there a way to surpress the error-massage?
The VBA runs correctly, so I need to cancel every pop-up form when opening the workbook..
__________________
Ties Blom
Senior Application Developer BI
Getronics Healthcare
DB2,ORACLE,Powercenter,BusObj,Access,
SQL, SQL server
Reply With Quote
  #2 (permalink)  
Old 10-03-05, 09:54
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Howdy. Two points:

1. Code
Code:
Application.DisplayAlerts = False
Display alerts only works when the macro is running. So, the best place to use the above code is in the Open Workbook module.

expression.Open(FileName, UpdateLinks[I], ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter, Editable, Notify, Converter, AddToMru, Local, CorruptLoad)

Value Meaning
0 Doesn 't update any references
1 Updates external references but Not remote references
2 Updates remote references but Not external references
3 Updates both remote And external references



2. Preferences

If you want to turn off the "Update Links" prompt. Go to Edit - Edit Links - Startup Prompt and then change the preferences.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums

Last edited by shades; 10-03-05 at 09:58.
Reply With Quote
  #3 (permalink)  
Old 10-03-05, 10:29
blom0344 blom0344 is offline
Registered User
 
Join Date: Jan 2003
Location: Zutphen,Netherlands
Posts: 256
Thank you.
In my case It looks like the errormessage does not originate from Excel itself.
If I use your code, I still get the pop-up error message.
Possible, the message is created by MS Query (as this was used initially to create a connection to the offline cube)
Any other ideas?
__________________
Ties Blom
Senior Application Developer BI
Getronics Healthcare
DB2,ORACLE,Powercenter,BusObj,Access,
SQL, SQL server
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On