Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Meg Meg is offline
external usenet poster
 
Posts: 22
Default Remover ODBC Dialog Box

I have a macro that creates a Pivot Table using ODBC connection. Everyting I
run it, the dialog box pops up and I must choose the MACHINE DATA SOURCE tab
and then select the correct ODBC connection.

How do I remove this from displaying each time this macro is run?

Here is the code:

Sub Create_Pivot_Table()
'
'

'
Range("A6").Select
Workbooks("Book1").Connections.Add "ARSYSTEM
SITE_PATIENT_REGISTRATION5", "", _
Array(Array( _
"ODBC;DSN=Dim;Description=Dim;UID=usr;APP=2007 Microsoft Office
system;WSID=D820_XP_09;DATABASE=Medical;AutoTransl ate=No;Trusted_Conn" _
), Array("ection=Yes;UseProcForPrepare=0;QuotedId=No; AnsiNPW=No")),
Array( _
"EXECUTE [dbo].[SITE_SP_PATIENT_MATRIX]
'MAIN','2007-04-01','2007-04-14'"), 2
ActiveWorkbook.PivotCaches.Create(SourceType:=xlEx ternal, SourceData:= _
ActiveWorkbook.Connections("ARSYSTEM SITE_PATIENT_REGISTRATION5"),
Version:= _
xlPivotTableVersion12).CreatePivotTable
TableDestination:="Sheet1!R6C1", _
TableName:="PivotTable1", DefaultVersion:=xlPivotTableVersion12
Cells(6, 1).Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("DATE_ADDED")
.Orientation = xlRowField
.Position = 1
End With
With
ActiveSheet.PivotTables("PivotTable1").PivotFields ("Account_and_Name")
.Orientation = xlRowField
.Position = 2
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("ACTION_TYPE")
.Orientation = xlColumnField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("USERID")
.Orientation = xlColumnField
.Position = 2
End With
ActiveSheet.PivotTables("PivotTable1").AddDataFiel d
ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("TRX_COUNT"), "Sum of TRX_COUNT", xlSum
End Sub

Thanks,

MEG
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate Remover CVandijk Excel Discussion (Misc queries) 1 November 25th 08 08:49 PM
Remover number from one sheet to another Therese Excel Discussion (Misc queries) 1 July 19th 08 12:58 AM
unique item remover doc Excel Discussion (Misc queries) 1 November 13th 07 06:49 PM
Duplicate remover carlito_1985[_2_] Excel Programming 5 August 26th 05 07:14 AM
Duplicate remover T-®ex[_28_] Excel Programming 0 August 26th 05 06:39 AM


All times are GMT +1. The time now is 06:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"