Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Creating Excel Sheet using VB 2005

I am trying to connect to servers and import data and attributes from the
servers into excel. What is the best way to do this? I have to connection
part of the code wriitten and can connect to any server I choose. I am not
working on creating the excel spreadsheet with the data.

I have Imported the Microsoft.Office.Interop.Excel package into my program.
Should I be using the ListColumns.Add and the ListRows.Add functions to
populate the spreadsheet from the data imported by the server?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Creating Excel Sheet using VB 2005



"mdup" wrote:

I am trying to connect to servers and import data and attributes from the
servers into excel. What is the best way to do this? I have to connection
part of the code wriitten and can connect to any server I choose. I am now
working on creating the excel spreadsheet with the data.

I have Imported the Microsoft.Office.Interop.Excel package into my program.
Should I be using the ListColumns.Add and the ListRows.Add functions to
populate the spreadsheet from the data imported by the server?

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Creating Excel Sheet using VB 2005

Sorry I mistyped some of the initial post. I am NOW (instead of not) working
on creating the excel spreadsheet with the data. I have been using the Object
Browser to try and find the commands I need to use to import the data. Below
is a code i have written to import the data but it does have some issues.



#Region " (Import Data) This function will import the PI Tag Names and
desired Attributes into an Excel worksheet "
Private Sub Import()
'Declare Variables for Data Retrevial

'Dim srv As Server ' server object
Dim nvs As PISDKCommon.NamedValues 'list of attribute names to
get
Dim piPoint As PIPoint
Dim pAttrs As PISDKCommon.NamedValues
Dim pAtt As PISDKCommon.NamedValue
Dim pList As PointList
Dim getEx As IGetPoints2
Dim List1 As Excel.RTD
Dim List2 As Excel.RTD

On Error GoTo err
getEx = myServer


pList = getEx.GetPoints2("tag='" & " * " & "'", nvs,
GetPointsRetrievalTypes.useGetPoints)
For Each piPoint In pList
List1.AddItem(piPoint.Name)
Next
Exit Sub
err:
MsgBox("Error in call:" & Err.Description)

On Error Resume Next

List2.Clear()
piPoint = myServer.PIPoints(List1.Text)
pAttrs = piPoint.PointAttributes.GetAttributes 'Fetch returned
attributes as NamedValues
For Each pAtt In pAttrs 'Run thru all attributes
List2.AddItem(pAtt.Name & ": " & CStr(pAtt.Value)) 'Show name
and value
Next

nvs = New PISDKCommon.NamedValues
nvs.Add("archiving", 1)



And more attributes follow the nvs.Add("archiving") line. I am also not sure
if this is how List1 and List2 should be defined Dim List1 As Excel.RTD, Dim
List2 As Excel.RTD. I thought more details on the code and and problem I am
having would help. The code is being written so that it does not require any
clicking to operate. This should be an automated process.

Thanks again in advance.

"mdup" wrote:

I am trying to connect to servers and import data and attributes from the
servers into excel. What is the best way to do this? I have to connection
part of the code wriitten and can connect to any server I choose. I am not
working on creating the excel spreadsheet with the data.

I have Imported the Microsoft.Office.Interop.Excel package into my program.
Should I be using the ListColumns.Add and the ListRows.Add functions to
populate the spreadsheet from the data imported by the server?

Thanks in advance.

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
Format date as Custom YYYY yields 2005, but fx still shows 1/1/2005 Captain Snuggles Excel Programming 2 October 27th 07 11:11 PM
Convert alphanumerical(eg. 12.11.2005) to date as 12-Nov-2005 in e Safi Excel Discussion (Misc queries) 3 June 1st 06 04:35 PM
Creating xll files for excel 2003 with Visual C++ 2005 express JacksonRJones Excel Programming 0 March 15th 06 10:06 PM
Creating .xll files in visual c++ 2005 express. JacksonRJones Excel Programming 0 March 15th 06 07:37 PM
chnage date from tuesday 4 January 2005 10:39.26 to 04/01/2005 Jonny1975 Excel Worksheet Functions 1 June 6th 05 10:13 AM


All times are GMT +1. The time now is 09:40 PM.

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"