Array Question Part 2

Some of this is extremely new to me.  Code below is info I have been piecing 
together.

From what I can determine the line below doesn't appear to be 
saving/appending my object
$myCollection += new-object PSObject -properties $myServerObject

If I use write-output on any of the select-strings commands it is properly 
updating $myServerObject with the expected value.  Does any one see what is 
wrong with this code?


$Servers = Import-CSV -Path $fileServers

# Create an array to store objects
$myCollection = @()

# Parse all the servers
foreach($Server in $Servers)
{
 $myServerObject = @{}
 $myServerObject.Name    = $Server.name
 if(Select-String -pattern $Server.name -path 
$filePatchlink){$myServerObject.Patch = "x"}
 if(Select-String -pattern $Server.name -path 
$fileSolarwinds){$myServerObject.Monitor = "x"}
 if(Select-String -pattern $Server.name -path 
$fileNBU){$myServerObject.Backup = "x"}
 if(Select-String -pattern $Server.name -path 
$fileHardware){$myServerObject.Physical= "x"}
 if(Select-String -pattern $Server.name -path 
$fileVMWare){$myServerObject.Virtual = "x"}
 if(Select-String -pattern $Server.name -path $fileTrend){$myServerObject.AV 
= "x"}
 if(Select-String -pattern $Server.name -path $fileAD){$myServerObject.AD = 
"x"}

$myCollection += new-object PSObject -properties $myServerObject

}

# Export to CSV
$myCollection | Export-Csv $fileProcessed


-- 
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Microsoft's Thrive IT Pro of the Month - June 2009

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.


0
Paul
11/30/2009 9:59:08 PM
windows.powershell 690 articles. 0 followers. Follow

8 Replies
1396 Views

Similar Articles

[PageSpeed] 15

Hello Paul Bergson [MVP-DS],

> Some of this is extremely new to me.  Code below is info I have been
> piecing together.
> 
> From what I can determine the line below doesn't appear to be
> saving/appending my object
> $myCollection += new-object PSObject -properties $myServerObject
> If I use write-output on any of the select-strings commands it is
> properly updating $myServerObject with the expected value.  Does any
> one see what is wrong with this code?
> 
> $Servers = Import-CSV -Path $fileServers
> 
> # Create an array to store objects
> $myCollection = @()
> # Parse all the servers
> foreach($Server in $Servers)
> {
> $myServerObject = @{}
> $myServerObject.Name    = $Server.name
> if(Select-String -pattern $Server.name -path
> $filePatchlink){$myServerObject.Patch = "x"}
> if(Select-String -pattern $Server.name -path
> $fileSolarwinds){$myServerObject.Monitor = "x"}
> if(Select-String -pattern $Server.name -path
> $fileNBU){$myServerObject.Backup = "x"}
> if(Select-String -pattern $Server.name -path
> $fileHardware){$myServerObject.Physical= "x"}
> if(Select-String -pattern $Server.name -path
> $fileVMWare){$myServerObject.Virtual = "x"}
> if(Select-String -pattern $Server.name -path
> $fileTrend){$myServerObject.AV
> = "x"}
> if(Select-String -pattern $Server.name -path
> $fileAD){$myServerObject.AD =
> "x"}
> $myCollection += new-object PSObject -properties $myServerObject
> 
> }
> 
> # Export to CSV
> $myCollection | Export-Csv $fileProcessed
> http://www.pbbergs.com
> 
> Please no e-mails, any questions should be posted in the NewsGroup
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> 

Try:

$myCollection += new-object psobject -Property $myServerObject

Karl
http://unlockpowershell.wordpress.com/


0
Karl
11/30/2009 10:25:59 PM
VGhlcmUgaXMgYSBidWcvdHlwbyBpbiB0aGlzIGxpbmU6DQoNCiRteUNvbGxlY3Rpb24gKz0gbmV3
LW9iamVjdCBQU09iamVjdCAtcHJvcGVydGllcyAkbXlTZXJ2ZXJPYmplY3QNCg0KIyB0aGUgcGFy
YW1ldGVyIG5hbWUgaXMgUHJvcGVydHkNCg0KJG15Q29sbGVjdGlvbiArPSBuZXctb2JqZWN0IFBT
T2JqZWN0IC1wcm9wZXJ0eSAkbXlTZXJ2ZXJPYmplY3QNCg0KLi4udGhlIG90aGVyIHByb2JsZW0g
SSBzZWUgcyB0aGF0IHlvdSdyZSBub3QgYWRkaW5nIHRoZSByZXN0IG9mIHRoZSBmaWVsZHMgdG8g
dGhlIFBTT2JqZWN0LCBldmVuIGlmIHRoZXkncmUgYmxhbmsuDQoNClRoaXMgZGVtb25zdHJhdGVz
IHRoZSBidWc6DQoNCiRhcnIgPSBAKCkNCiRodCA9IEB7fQ0KJGh0Lm5hbWUgPSAnSm9obicNCiRh
cnIgKz0gbmV3LW9iamVjdCBQU09iamVjdCAtUHJvcGVydHkgJGh0DQoNCiRodC5hZ2UgPSAyMw0K
JGFyciArPSBuZXctb2JqZWN0IFBTT2JqZWN0IC1Qcm9wZXJ0eSAkaHQNCiRodC5jb3VudHJ5ID0g
J1VTQScNCiRhcnIgKz0gbmV3LW9iamVjdCBQU09iamVjdCAtUHJvcGVydHkgJGh0DQokYXJyDQoN
ClRoaXMgd29ya3MgYXMgZXhwZWN0ZWQ6DQoNCiRhcnIgPSBAKCkNCiRodCA9IEB7fQ0KJGh0Lm5h
bWUgPSAnSm9obicNCiRodC5hZ2UgPSAnJw0KJGh0LmNvdW50cnkgPSAnJw0KJGFyciArPSBuZXct
b2JqZWN0IFBTT2JqZWN0IC1Qcm9wZXJ0eSAkaHQNCiRodC5uYW1lID0gJycNCiRodC5hZ2UgPSAy
Mw0KJGh0LmNvdW50cnkgPSAnJw0KJGFyciArPSBuZXctb2JqZWN0IFBTT2JqZWN0IC1Qcm9wZXJ0
eSAkaHQNCiRodC5uYW1lID0gJycNCiRodC5hZ2UgPSAnJw0KJGh0LmNvdW50cnkgPSAnVVNBJw0K
JGFyciArPSBuZXctb2JqZWN0IFBTT2JqZWN0IC1Qcm9wZXJ0eSAkaHQNCiRhcnINCg0KDQotLSAN
ClJvYmVydA==

0
Robert
11/30/2009 10:36:52 PM
Yes that was it.  I also needed to prepopulate all fields otherwise the 
object creation didn't work correctly, as Robert pointed out.

Can I ask two followup questions?  The updated code is at the bottom of this 
new inquiry
1) Is there a way to order the rows on the csv output?  I had hoped to get 
the output with the name as the first column.

2) The following line is the first line listed in my csv output file.  Is 
there a way to prevent that from being placed in the csv file?
#TYPE System.Management.Automation.PSCustomObject





$Servers = Import-CSV -Path $fileServers

# Create an array to store objects
$myCollection = @()

# Parse all the servers
foreach($Server in $Servers)
{

 $myServerObject = @{}
 $myServerObject.Name     = $Server.name
    $myServerObject.Patch    = " "
    $myServerObject.Monitor  = " "
    $myServerObject.Backup   = " "
    $myServerObject.Physical = " "
    $myServerObject.Virtual  = " "
    $myServerObject.AV       = " "
    $myServerObject.AD       = " "
 if(Select-String -pattern $Server.name -path 
$filePatchlink){$myServerObject.Patch = "x"}
 if(Select-String -pattern $Server.name -path 
$fileSolarwinds){$myServerObject.Monitor = "x"}
 if(Select-String -pattern $Server.name -path 
$fileNBU){$myServerObject.Backup = "x"}
    if(Select-String -pattern $Server.name -path 
$fileHardware){$myServerObject.Physical= "x"}
 if(Select-String -pattern $Server.name -path 
$fileVMWare){$myServerObject.Virtual = "x"}
 if(Select-String -pattern $Server.name -path $fileTrend){$myServerObject.AV 
= "x"}
 if(Select-String -pattern $Server.name -path $fileAD){$myServerObject.AD = 
"x"}

    $myCollection += new-object PSObject -property $myServerObject

}

# Export to CSV
$myCollection | Export-Csv $fileProcessed


-- 
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Microsoft's Thrive IT Pro of the Month - June 2009

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.

"Karl Mitschke" <karlmitschke@somestate.gov> wrote in message 
news:d66cd4c2186bb8cc3fe88dca5c10@msnews.microsoft.com...
> Hello Paul Bergson [MVP-DS],
>
>> Some of this is extremely new to me.  Code below is info I have been
>> piecing together.
>>
>> From what I can determine the line below doesn't appear to be
>> saving/appending my object
>> $myCollection += new-object PSObject -properties $myServerObject
>> If I use write-output on any of the select-strings commands it is
>> properly updating $myServerObject with the expected value.  Does any
>> one see what is wrong with this code?
>>
>> $Servers = Import-CSV -Path $fileServers
>>
>> # Create an array to store objects
>> $myCollection = @()
>> # Parse all the servers
>> foreach($Server in $Servers)
>> {
>> $myServerObject = @{}
>> $myServerObject.Name    = $Server.name
>> if(Select-String -pattern $Server.name -path
>> $filePatchlink){$myServerObject.Patch = "x"}
>> if(Select-String -pattern $Server.name -path
>> $fileSolarwinds){$myServerObject.Monitor = "x"}
>> if(Select-String -pattern $Server.name -path
>> $fileNBU){$myServerObject.Backup = "x"}
>> if(Select-String -pattern $Server.name -path
>> $fileHardware){$myServerObject.Physical= "x"}
>> if(Select-String -pattern $Server.name -path
>> $fileVMWare){$myServerObject.Virtual = "x"}
>> if(Select-String -pattern $Server.name -path
>> $fileTrend){$myServerObject.AV
>> = "x"}
>> if(Select-String -pattern $Server.name -path
>> $fileAD){$myServerObject.AD =
>> "x"}
>> $myCollection += new-object PSObject -properties $myServerObject
>>
>> }
>>
>> # Export to CSV
>> $myCollection | Export-Csv $fileProcessed
>> http://www.pbbergs.com
>>
>> Please no e-mails, any questions should be posted in the NewsGroup
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>
> Try:
>
> $myCollection += new-object psobject -Property $myServerObject
>
> Karl
> http://unlockpowershell.wordpress.com/
>
> 


0
Paul
12/1/2009 2:12:48 PM
Yes that was it.  I also needed to prepopulate all fields otherwise the 
object creation didn't work correctly, as you pointed out.

Can I ask two followup questions?  The updated code is at the bottom of this 
new inquiry
1) Is there a way to order the rows on the csv output?  I had hoped to get 
the output with the name as the first column.

2) The following line is the first line listed in my csv output file.  Is 
there a way to prevent that from being placed in the csv file?
#TYPE System.Management.Automation.PSCustomObject





$Servers = Import-CSV -Path $fileServers

# Create an array to store objects
$myCollection = @()

# Parse all the servers
foreach($Server in $Servers)
{

 $myServerObject = @{}
 $myServerObject.Name     = $Server.name
    $myServerObject.Patch    = " "
    $myServerObject.Monitor  = " "
    $myServerObject.Backup   = " "
    $myServerObject.Physical = " "
    $myServerObject.Virtual  = " "
    $myServerObject.AV       = " "
    $myServerObject.AD       = " "
 if(Select-String -pattern $Server.name -path 
$filePatchlink){$myServerObject.Patch = "x"}
 if(Select-String -pattern $Server.name -path 
$fileSolarwinds){$myServerObject.Monitor = "x"}
 if(Select-String -pattern $Server.name -path 
$fileNBU){$myServerObject.Backup = "x"}
    if(Select-String -pattern $Server.name -path 
$fileHardware){$myServerObject.Physical= "x"}
 if(Select-String -pattern $Server.name -path 
$fileVMWare){$myServerObject.Virtual = "x"}
 if(Select-String -pattern $Server.name -path $fileTrend){$myServerObject.AV 
= "x"}
 if(Select-String -pattern $Server.name -path $fileAD){$myServerObject.AD = 
"x"}

    $myCollection += new-object PSObject -property $myServerObject

}

# Export to CSV
$myCollection | Export-Csv $fileProcessed


-- 
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Microsoft's Thrive IT Pro of the Month - June 2009

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.

"Robert Robelo" <Kiron@HighPlainsDrifter.com> wrote in message 
news:u7Qeh2gcKHA.808@TK2MSFTNGP02.phx.gbl...
> There is a bug/typo in this line:
>
> $myCollection += new-object PSObject -properties $myServerObject
>
> # the parameter name is Property
>
> $myCollection += new-object PSObject -property $myServerObject
>
> ...the other problem I see s that you're not adding the rest of the fields 
> to the PSObject, even if they're blank.
>
> This demonstrates the bug:
>
> $arr = @()
> $ht = @{}
> $ht.name = 'John'
> $arr += new-object PSObject -Property $ht
>
> $ht.age = 23
> $arr += new-object PSObject -Property $ht
> $ht.country = 'USA'
> $arr += new-object PSObject -Property $ht
> $arr
>
> This works as expected:
>
> $arr = @()
> $ht = @{}
> $ht.name = 'John'
> $ht.age = ''
> $ht.country = ''
> $arr += new-object PSObject -Property $ht
> $ht.name = ''
> $ht.age = 23
> $ht.country = ''
> $arr += new-object PSObject -Property $ht
> $ht.name = ''
> $ht.age = ''
> $ht.country = 'USA'
> $arr += new-object PSObject -Property $ht
> $arr
>
>
> -- 
> Robert 


0
Paul
12/1/2009 2:13:12 PM
MS4gUGlwZSB0aGUgY29sbGVjdGlvbiB0byBTZWxlY3QtT2JqZWN0IHRvIHNldCB0aGUgb3JkZXIg
b2YgdGhlIGZpZWxkcywgSGFzaHRhYmxlcyBkb24ndCBrZWVwIHRoZSBvcmRlciwgYmVmb3JlIGV4
cG9ydGluZy4NCjIuIFVzZSBFeHBvcnQtQ1NWJ3MgLU5vVHBlSW5mb3JtYXRpb24gc3dpdGNoICgt
TlRJKSBhcyBLYXJsIGFscmVhZHkgcG9pbnRlZCBvdXQuDQoNCiMgY2hhbmdlIHRoaXMgbGluZToN
CiRteUNvbGxlY3Rpb24gfCBFeHBvcnQtQ3N2ICRmaWxlUHJvY2Vzc2VkDQoNCiMgdG8uLi4NCiRt
eUNvbGxlY3Rpb24gfA0KIFNlbGVjdC1PYmplY3QgTmFtZSwgUGF0Y2gsIE1vbml0b3IsIEJhY2t1
cCwgUGh5c2ljYWwsIFZpcnR1YWwsIEFWLCBBRCB8DQogRXhwb3J0LUNzdiAkZmlsZVByb2Nlc3Nl
ZCAtTlRJDQoNCkkgd291bGQgc3VnZ2VzdCB0byB1c2UgU2VsZWN0LVN0cmluZydzIC1RdWlldCBz
d2l0Y2ggYWxzbywgdGhpcyByZXR1cm5zIGEgW0Jvb2xlYW5dIGluc3RlYWQgb2YgW01pY3Jvc29m
dC5Qb3dlclNoZWxsLkNvbW1hbmRzLk1hdGNoSW5mb10uDQoNCi0tIA0KUm9iZXJ0

0
Robert
12/1/2009 4:06:13 PM
1.) there is a way....

$Hashtable.GetEnumerator() | Sort

Martin

"Robert Robelo" <Kiron@HighPlainsDrifter.com> wrote in message 
news:uy5z3AqcKHA.612@TK2MSFTNGP06.phx.gbl...
> 1. Pipe the collection to Select-Object to set the order of the fields, 
> Hashtables don't keep the order, before exporting.
> 2. Use Export-CSV's -NoTpeInformation switch (-NTI) as Karl already 
> pointed out.
>
> # change this line:
> $myCollection | Export-Csv $fileProcessed
>
> # to...
> $myCollection |
> Select-Object Name, Patch, Monitor, Backup, Physical, Virtual, AV, AD |
> Export-Csv $fileProcessed -NTI
>
> I would suggest to use Select-String's -Quiet switch also, this returns a 
> [Boolean] instead of [Microsoft.PowerShell.Commands.MatchInfo].
>
> -- 
> Robert 

0
Martin
12/1/2009 5:35:25 PM
You can simplify the object creation like so:

$props = @"
Name=$Server.name
Patch = 
monitor=
Backup= 
Physical= 
Virtual = 
AV= 
AD=
"@

 $myServerObject = new-object psobjec -property (convertfrom-stringdata 
$props)

or:

$myServerObject = "" | select Name,patch,monitor,backup,physical,virtual,AV,AD
$myServerObject.name = $server.name



$myServerObject = @{}
"Paul Bergson [MVP-DS]" wrote:

> Yes that was it.  I also needed to prepopulate all fields otherwise the 
> object creation didn't work correctly, as Robert pointed out.
> 
> Can I ask two followup questions?  The updated code is at the bottom of this 
> new inquiry
> 1) Is there a way to order the rows on the csv output?  I had hoped to get 
> the output with the name as the first column.
> 
> 2) The following line is the first line listed in my csv output file.  Is 
> there a way to prevent that from being placed in the csv file?
> #TYPE System.Management.Automation.PSCustomObject
> 
> 
> 
> 
> 
> $Servers = Import-CSV -Path $fileServers
> 
> # Create an array to store objects
> $myCollection = @()
> 
> # Parse all the servers
> foreach($Server in $Servers)
> {
> 
>  $myServerObject = @{}
>  $myServerObject.Name     = $Server.name
>     $myServerObject.Patch    = " "
>     $myServerObject.Monitor  = " "
>     $myServerObject.Backup   = " "
>     $myServerObject.Physical = " "
>     $myServerObject.Virtual  = " "
>     $myServerObject.AV       = " "
>     $myServerObject.AD       = " "
>  if(Select-String -pattern $Server.name -path 
> $filePatchlink){$myServerObject.Patch = "x"}
>  if(Select-String -pattern $Server.name -path 
> $fileSolarwinds){$myServerObject.Monitor = "x"}
>  if(Select-String -pattern $Server.name -path 
> $fileNBU){$myServerObject.Backup = "x"}
>     if(Select-String -pattern $Server.name -path 
> $fileHardware){$myServerObject.Physical= "x"}
>  if(Select-String -pattern $Server.name -path 
> $fileVMWare){$myServerObject.Virtual = "x"}
>  if(Select-String -pattern $Server.name -path $fileTrend){$myServerObject.AV 
> = "x"}
>  if(Select-String -pattern $Server.name -path $fileAD){$myServerObject.AD = 
> "x"}
> 
>     $myCollection += new-object PSObject -property $myServerObject
> 
> }
> 
> # Export to CSV
> $myCollection | Export-Csv $fileProcessed
> 
> 
> -- 
> Paul Bergson
> MVP - Directory Services
> MCTS, MCT, MCSE, MCSA, Security+, BS CSci
> 2008, 2003, 2000 (Early Achiever), NT4
> Microsoft's Thrive IT Pro of the Month - June 2009
> 
> http://www.pbbergs.com
> 
> Please no e-mails, any questions should be posted in the NewsGroup This
> posting is provided "AS IS" with no warranties, and confers no rights.
> 
> "Karl Mitschke" <karlmitschke@somestate.gov> wrote in message 
> news:d66cd4c2186bb8cc3fe88dca5c10@msnews.microsoft.com...
> > Hello Paul Bergson [MVP-DS],
> >
> >> Some of this is extremely new to me.  Code below is info I have been
> >> piecing together.
> >>
> >> From what I can determine the line below doesn't appear to be
> >> saving/appending my object
> >> $myCollection += new-object PSObject -properties $myServerObject
> >> If I use write-output on any of the select-strings commands it is
> >> properly updating $myServerObject with the expected value.  Does any
> >> one see what is wrong with this code?
> >>
> >> $Servers = Import-CSV -Path $fileServers
> >>
> >> # Create an array to store objects
> >> $myCollection = @()
> >> # Parse all the servers
> >> foreach($Server in $Servers)
> >> {
> >> $myServerObject = @{}
> >> $myServerObject.Name    = $Server.name
> >> if(Select-String -pattern $Server.name -path
> >> $filePatchlink){$myServerObject.Patch = "x"}
> >> if(Select-String -pattern $Server.name -path
> >> $fileSolarwinds){$myServerObject.Monitor = "x"}
> >> if(Select-String -pattern $Server.name -path
> >> $fileNBU){$myServerObject.Backup = "x"}
> >> if(Select-String -pattern $Server.name -path
> >> $fileHardware){$myServerObject.Physical= "x"}
> >> if(Select-String -pattern $Server.name -path
> >> $fileVMWare){$myServerObject.Virtual = "x"}
> >> if(Select-String -pattern $Server.name -path
> >> $fileTrend){$myServerObject.AV
> >> = "x"}
> >> if(Select-String -pattern $Server.name -path
> >> $fileAD){$myServerObject.AD =
> >> "x"}
> >> $myCollection += new-object PSObject -properties $myServerObject
> >>
> >> }
> >>
> >> # Export to CSV
> >> $myCollection | Export-Csv $fileProcessed
> >> http://www.pbbergs.com
> >>
> >> Please no e-mails, any questions should be posted in the NewsGroup
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >
> > Try:
> >
> > $myCollection += new-object psobject -Property $myServerObject
> >
> > Karl
> > http://unlockpowershell.wordpress.com/
> >
> > 
> 
> 
> .
> 
0
Utf
12/1/2009 6:44:01 PM
Got it all working.  Thx!!!

-- 
Paul Bergson
MVP - Directory Services
MCTS, MCT, MCSE, MCSA, Security+, BS CSci
2008, 2003, 2000 (Early Achiever), NT4
Microsoft's Thrive IT Pro of the Month - June 2009

http://www.pbbergs.com

Please no e-mails, any questions should be posted in the NewsGroup This
posting is provided "AS IS" with no warranties, and confers no rights.

"Robert Robelo" <Kiron@HighPlainsDrifter.com> wrote in message 
news:uy5z3AqcKHA.612@TK2MSFTNGP06.phx.gbl...
> 1. Pipe the collection to Select-Object to set the order of the fields, 
> Hashtables don't keep the order, before exporting.
> 2. Use Export-CSV's -NoTpeInformation switch (-NTI) as Karl already 
> pointed out.
>
> # change this line:
> $myCollection | Export-Csv $fileProcessed
>
> # to...
> $myCollection |
> Select-Object Name, Patch, Monitor, Backup, Physical, Virtual, AV, AD |
> Export-Csv $fileProcessed -NTI
>
> I would suggest to use Select-String's -Quiet switch also, this returns a 
> [Boolean] instead of [Microsoft.PowerShell.Commands.MatchInfo].
>
> -- 
> Robert 


0
Paul
12/2/2009 1:08:30 PM
Reply:

Similar Artilces:

"Array Index Out of Bounds"
I recently purchased "Office Professional Ed 2003." With it came "Business Contact Manager." When I double click to open a particular contact or business contact, I get the above "subject" message. Is there a reason, fix, or solution for this? Thanks, John ...

vbs for macro #2
orig post'g: i have an inventory of appx 1000 serial numbers. using keystroke recording, i can populate 2 - 6 fields on 4 green screens to complete a process on one serial number. is there a way to tweak my macro to incrementally continue, automatically, from a list stored in an excel worksheet on the client? would be very grateful for fresh ideas. follow up: 1st...thank you for giving me hope! the macro feeds to a cics dummy screen (input only form) linking to corp dBase from nt/ws 4.0 sp6. Attached below is the macro, which i would like to link to an excel worksheet (C:\temp\serN...

additem to combobox with an array
hi, i'm trying to add itemns to an multicolumn combobox (3 columns) using an array. if i just try to add 1 column there is no problems, but when i try t add more columns to the combobox it wont work anymore. tips anyone? tia jock -- jock ----------------------------------------------------------------------- jocke's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=76 View this thread: http://www.excelforum.com/showthread.php?threadid=47167 Did you change the .columncount property? I made a small userform and picked up some values off a worksheet to create...

Visio 2000 (Font Question)
I'm trying to have my text with a black boarder but filled with a different color. How do I do this? eg. outline black, fill red. TIA If you have Office installed, insert a Wordart object into Visio. Randall Arnold "ShipHead" <GoAway@SpamBoy.com> wrote in message news:u7W0b10oDHA.2868@TK2MSFTNGP09.phx.gbl... > I'm trying to have my text with a black boarder but filled with a different > color. > How do I do this? eg. outline black, fill red. > > TIA > > > Select text box; Format | Line, and Format | Fill Pemo -- ,-._|\ / Oz \ ...

Option Group Question 10-12-07
I have a form with an option group with 5 choices available. The fieldname/control source where this info will be stored is BusUnit: All 1 GC 2 GSP 3 GT 4 SPX 5 As I am sure you already know the value that is saved in my table is the numeric value noted above. That means little to the user. I want the corresponding text value to be saved in my table instead, and I want my default text value to be "All". Note: within my option group, 1 is the default as defined when created using the Wizard. So when a new record is being populated or created the default value is &...

hosting 2 domains
I'm hosting 2 domain names for my exchange server, the 2nd domain can receive e-mail but it cannot send out mail through its own domain name. Any ideas of what I will need to do. By default, all emails leaving your system will be stamped with the domain you have listed as your Primary SMTP address in your recipient policy. You can recieve for any you have listed, but it will always send as the primary. You can create 2 new recipient policy's for each domain. Then you can assign those policies to the users in thier respective domains and set the Primary SMTP address different...

X500 question
hi... in the middle of a site consolidation/migration from 5.5 to 2003. when I do a cross-site mailbox move the AD account gets 2 X500 addresses... 1 for the old site and 1 for the new. I assume this is normal, and necessary for mail to continue to flow between moved and nonmoved mailboxes. the interesting thing is that both x500 addresses are set to primary (they're both bold with a capital X), and the "set as primary" option is not available. using ADSIEDIT I can change one of these to secondary by making one of the X's lower case, and then the set as primary option ...

An embarrasing question
Just compiled a C++ program with the "VS 2003 dotnet IDE". I have a *tad* experience with VS6 where there was a button widget that had a red '!' on it, which meant "run the program". I'm looking at VS 2003 dotnet, and don't see the button with an exclamation point. I don't see anything that appears like it would run the program. When I started the project, I made it a "console app". It compiled. Now how do I run it? *sheepish grin* Thanks, Pete Hit Ctrl+F5. Exclamation point in VC6 is no longer available in VS2003/VS2005. You can cus...

Split into 2 tables?
Hi all, I have a pond database I'm working on. We have weather data and notes associated with a set of data collected for one pond on one day. We have "current weather" (current weather noted for the day - ambient temperature, wind speed, etc.) and "previous weather" which consists of notes about what the weather has been like the past day or two. These data are contained in one table linked to the main pond data table via foreign key... Should they be split into 2 tables - one for current weather, one for previous weather? What are the questions o...

SMTP connector, one last question...
my exchange setup is configured to handle mail for the active directory domain "domain1.com". i needed it to also handle mail for the domain "domain2.com". i was told that for this i need an smtp connector, which is what i did. i created an additional smtp connector and told it to forward all mail for the new domain to itslef. which seems weird to me. tell me this, can i get rid of all the smtp connectors and have the default smtp server handle mail for multiple domains? i have already updated the default recipient policy to allow for the creation of addresses in the domai...

=if QUESTION
THIS IS WHAT I WOULD LIKE TO DO: IF K39-I30 IS =>.25% OF K39, THEN DEDUCT .50% OF DIFFERENCE/REMAINDING TO BE PLACED IN K42. SOME HOW IT IS NOT DOING WHAT I THINK IS CORRECT WHEN I REDO IT ON PAPER. Colin2u, In K42 IF (I30<=K39*0.75,(K39-I30)*0.5,"") Henry "Colin2u" <Colin2u@discussions.microsoft.com> wrote in message news:1EE91555-3355-42D7-AC84-D2ABFEF388C8@microsoft.com... > THIS IS WHAT I WOULD LIKE TO DO: > IF K39-I30 IS =>.25% OF K39, THEN DEDUCT .50% OF DIFFERENCE/REMAINDING TO > BE > PLACED IN K42. > SOME HOW IT IS NOT DOING WHAT...

Macro Button Question
Heya All, I am trying to insert and delete rows using macros. Ive assigned the Macro to a button, but would like to be able to insert (and delete) exactly where the button is on the worksheet, no matter where the activecell is.. So, I guess my question is, is it possible to get the cell reference behind a graphic button? Or, even better, assign a macro to a cell? ta, Maria Maria There are "insert row" and "insert column" buttons available from Tools>Customize>Commands>Insert Also "delete row" and "delete column" buttons available from To...

starter question
I'm in an office with 5 networked computers. all incoming/outgoing mail uses the same address (POP3 account). A single machine running Outlook Express is used by all of us, in rotation, for email. This is inconvenient and inefficient! We all have Office (and can install Outlook). Is it possible to set up a system whereby all the machines can view the same inbox, outbox, and saved folders (stored just on a single machine), and that changes made by one user (e.g. marking an email as 'read') are reflected on everyone's screens? Ideally all machines would be viewing the folders si...

Very specific Question???
Ready? I have an Access database (2000 format running on 2007) connecting through an ODBC to PostgreSQL. Postgres queries are very particular i.e. case sensitive. Now that we have that out of the way...here is the problem. I am using a combo box in a form to assign a variable to a table. There are three options available in the combo box. I won't go into detail...it is entered like this: option1;option2;option3; Access removes the last semicolon...so now whenever the value is written to the table it sees: option3 <space><space><space><space><space> (...

A Review question from the Microsoft book(exam 70-536)
Hi! I'm reading a book from Microsoft Press (exam 70-536) and there is some Review questions after each chaper. Here is the question "Which command would you use to close the application domain in the following code sample." AppDomain d = AppDomain.CreateDomain("New Domain"); d.ExecuteAssemblyByName("MyAssembly"); A. d. DomainUnload() B. d = null C. d.Unload() D. AppDomain.Unload(d) The right answer according to the book is B and D. I have guessed only at D because I can't find why B is also included in the right answer. Because of...

Easy question (just not for me)
I am trying to drag down a date for monday through friday throughout the year: monday tuesday wednesday thursday friday monday tuesday ect... What would be or how would I make it to where it skips the saturday/sunday dates to go right to the next monday date? Thanks in advance Hi With 04/01/2010 in cell A1, enter the folowing formula in A2 and copy down as required =IF(WEEKDAY(A1,2)=5,A1+3,A1+1) -- Regards Roger Govier "Confusicous" <Confusicous@discussions.microsoft.com> wrote in message news:D2DEE129-6230-43DB-8C97-FEA42534354D@microsoft.com... &...

Radar Plot using geographical coordinates #2
I am trying to generate a circular radar or XY scatter point plot using geographical coordinates referenced to a tower in the aproximate center (with its own geographical coordinates and the plotted data in 4 quadrants (+X/+Y, -X/+Y, -X/-Y and +X/-Y) in order to plot the RF field strength of an FM broadcast station. I have 5 columns of data: 1 the Latitude coordinates of the tower for center reference. 2 the Longitude coordinates of the tower for center reference. 3 the Latitude coordinates where I took the measurements. 4 the Longitude coordinates where I took the measurements. 5 The RF...

Array+Array
Hi, I have 2 (or more) arrays, how can i combine them into 1? example: Array 1 = "1, 2, 3, 4" Array 2 = "A, B, C, D, E, F" Result: Array_Combined = "1, 2, 3, 4, A, B, C, D, E, F" br, Danny On Jan 7, 9:23=A0am, Danny <dannypct...@gmail.com> wrote: > Hi, > > I have 2 (or more) arrays, how can i combine them into 1? > > example: > Array 1 =3D "1, 2, 3, 4" > Array 2 =3D "A, B, C, D, E, F" > > Result: > Array_Combined =3D "1, 2, 3, 4, A, B, C, D, E, F" > > br, >...

Question on Table: Constants
Is it safe to use this table to get the List View Line Item Number. For example in the window "Receivings Transaction Entry" Open "Purchasing Distribution Entry" window" The Type column has drop down lists and Work In Progress is one of the items for Project accounting cost category. And in the table Constants if you query the column Name "Name" for "POP_DIST_WIP" You'll find the right matching Line number "15" as a value. I just want to know if this table will be available in the future updates and if it will be updated wit...

How to count same numbers in a coluum #2
Thanks Frank, Now, to find out what a pivot table is. :) Fran -- FPA186 ----------------------------------------------------------------------- FPA1869's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1470 View this thread: http://www.excelforum.com/showthread.php?threadid=26336 Here are some links for pivottable info: Debra Dalgleish's pictures at Jon Peltier's site: http://peltiertech.com/Excel/Pivots/pivottables.htm And Debra's own site: http://www.contextures.com/xlPivot01.html John Walkenbach also has some at: http://j-walk.com/ss/excel/...

Excel VBA PageSetup Questions
Hi, I want to specify that my xlSheet objects page setup so that fit page is enabled and put Page X of Y in the footer. I have so far: With xlSheetNew.PageSetup .Orientation = xlLandscape .FitToPagesWide = 1 .FitToPagesTall = 1000 .LeftFooter = "Engman-Taylor Co." .CenterFooter = "Page " End With My two problems are fittopage is not activated and I don't know how to reference page and pages in the footer. Can anyone help me? TIA, Dan Dan Simply setting the properties enables f...

Question about interpolation
Hi I have points deffined with x,y and z coordinates. Now I want to give x, y coordinate of new point and based on othe points to calculate Z for this new point. How can I do it in Excel Than ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com You need to do 2-variable regression. I have used this a lot in the past. I think it is now an add-in to Excel (I did it in Lotus - excuse me - many years ago). This gives you the coefficents of an equation of the type: z = r1 x + r2...

Basic question regarding checkboxes
Hello. I want to check a checkbox using the CheckDlgButton (hWND,IDC_CHECK1,BE_CHECKED) command The checkbox resides in a Dialog box called IDD_MYAPPLICATION_DIALOG. However, when I put this in the hWND field I get the error error C2664: 'CheckDlgButton' : cannot convert parameter 1 from 'int' to 'HWND' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast What do I have to put in the hWND field to make this work? Cheers >>The checkbox resides in a Dialog box called IDD_MYAPPLICATION_DIALOG. How...

2 Que's regarding dates (matching and subtracting) #2
Thanks for the help! Okay, I got que. #1 all figured out! #2 however, is still a little sticky. This is exactly what I'm trying to accomplish: The end-user enters a date in cell a2, validated to format DD/MM/YYYY. I want to look up that date and match it to a corresponding "table" on sheet3. On Sheet3, currently, I have the date, in M (September) format, in column B, and a value (%) in column C. Essentially, I want to input date ranges in this "table", so for column B2, it would be September 16th, 2004, to October 15th 2004 (instead of just September), but I do...

Chart Sizing #2
Using Excel 2000 - Is there a way of sizing a chart to an exact size instead of grabbing the sizing handles to size it? Thank you Hi Karen, If you select the chart whilst holding the CTRL key you can then set the width and height via the format dialog. Cheers Andy Karen wrote: > Using Excel 2000 - Is there a way of sizing a chart to an > exact size instead of grabbing the sizing handles to size > it? > > Thank you -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info >-----Original Message----- >Hi Karen, > >If you select the chart whilst holdi...