Running command line command without the DOS window

Hi I am trying to loop through a recordset and issue a dos command to start a 
service.  When I try to execute the code below, I get about 50 DOS windows 
opening at the same time, can anyone advise if I can execute these commands 
silently, and how can I capture the results?  All help is greatly 
appreciated...

Private Sub btnStartServices_Click()

    Dim rs As DAO.Recordset
    Dim strServer, strService, strCommand As String
    Dim strQry As String
       
    strQry = "qry01_StartServices"
    
    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
    If rs.RecordCount = 0 Then MsgBox "No Records"
    With rs
        .MoveFirst
        Do
        
        Set strServer = rs![Server]
        Set strService = rs![Service]
        
        Me![nowStarting] = strServer & " - " & strService
        Me.Refresh
        
        Set objShell = CreateObject("WScript.Shell")
        Set objExecObject = objShell.Exec("sc //" & strServer & " start " & 
strService)
        MsgBox objExecObject.StdOut.ReadAll()
                
        ' strCommand = "sc //" & strServer & " start " & strService
        
        ' Shell strCommand
   
        .MoveNext
        Loop Until .EOF
        .Close
    End With
    Set rst = Nothing

End Sub


0
Utf
2/5/2010 5:39:01 AM
access.modulesdaovba 1670 articles. 0 followers. Follow

7 Replies
1349 Views

Similar Articles

[PageSpeed] 52

"GLT" <GLT@discussions.microsoft.com> wrote in message 
news:5C9107A4-812C-4F91-BBEF-E0B337024542@microsoft.com...
> Hi I am trying to loop through a recordset and issue a dos command to 
> start a
> service.  When I try to execute the code below, I get about 50 DOS windows
> opening at the same time, can anyone advise if I can execute these 
> commands
> silently, and how can I capture the results?  All help is greatly
> appreciated...
>
> Private Sub btnStartServices_Click()
>
>    Dim rs As DAO.Recordset
>    Dim strServer, strService, strCommand As String
>    Dim strQry As String
>
>    strQry = "qry01_StartServices"
>
>    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
>    If rs.RecordCount = 0 Then MsgBox "No Records"
>    With rs
>        .MoveFirst
>        Do
>
>        Set strServer = rs![Server]
>        Set strService = rs![Service]
>
>        Me![nowStarting] = strServer & " - " & strService
>        Me.Refresh
>
>        Set objShell = CreateObject("WScript.Shell")
>        Set objExecObject = objShell.Exec("sc //" & strServer & " start " &
> strService)
>        MsgBox objExecObject.StdOut.ReadAll()
>
>        ' strCommand = "sc //" & strServer & " start " & strService
>
>        ' Shell strCommand
>
>        .MoveNext
>        Loop Until .EOF
>        .Close
>    End With
>    Set rst = Nothing
>
> End Sub
>
>

There are things you can do to hide the cmd window but they involve 3rd 
party apps to do it. CMDOW is one that I've used in the past. I'd just use 
WMI to start the services instead and not worry about the cmd windows. It 
doesn't look like you're using SC.exe for anything but starting the services 
and that can easily be done with WMI. Here are some examples of using WMI to 
work with services. 
http://www.computerperformance.co.uk/vbscript/wmi_services.htm

HTH

Matt 


0
Matt
2/5/2010 2:13:44 PM
Hi Matt,

Thanks for you reply and steering me in the right direction.

I have modified my code and when I run it, I get the following error:

Run-time error '-2147217385 (80041017)': Automation error

which occurs on this line:

For Each objService In colServices

A copy of my code is below.  Does anyone know what is causing this? 

Any assistance is always greatly appreciated.

Cheers,
GLT.

Private Sub btnStartServices_Click()

    Dim rs As DAO.Recordset
    Dim strServer, strService, strCommand As String
    Dim strQry As String
    Dim objWMIService As Object
    Dim colServices As Object
    Dim objService As Object
    Dim errReturnCode As Long
    Dim strErrorMessage As String
       
    strQry = "qry01_StartServices"
    
    errReturnCode = 9999
     
    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
    If rs.RecordCount = 0 Then MsgBox "No Records"
    With rs
        .MoveFirst
        Do
        
        strServer = "."
        Set strService = rs![Service]
        
        Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" _
        & strServer & "\root\cimv2")
        
        Set colServices = objWMIService.ExecQuery _
        ("SELECT * FROM Win32_Service" & _
        " WHERE Name = '" & strService & "'")
        
        Me![nowStarting] = strServer & " - " & strService
        Me.Refresh
        
        ' MsgBox (strServer & " - " & strService)
        
        For Each objService In colServices
            errReturnCode = objService.StartService()
        Next
        
        .MoveNext
        Loop Until .EOF
        .Close
    End With
    Set rs = Nothing

      Select Case errReturnCode
        Case Is = 0
            MsgBox "Service " & strServiceName & " has been" & _
                " started successfully.     ", vbInformation
        Case Is = 9999
            ' If errReturnCode has not changed the Service was not found
            MsgBox "Service """ & strServiceName & """ was not found" & _
                " and may not exist.       ", vbCritical
        Case Else
            ' Get the error messages supplied by Microsoft
            strErrorMessage = strErrorMessage = 
ErrReturnStateChange(errReturnCode)
            MsgBox "Service " & strServiceName _
                & " change failed.     " & vbCrLf & "Reason: " _
                & strErrorMessage & "        ", vbExclamation _
                , "Service Change Failed"
    End Select

SetServiceState = errReturnCode

Set objService = Nothing
Set colServices = Nothing
Set objWMIService = Nothing


End Sub

"Matt Williamson" wrote:

> 
> "GLT" <GLT@discussions.microsoft.com> wrote in message 
> news:5C9107A4-812C-4F91-BBEF-E0B337024542@microsoft.com...
> > Hi I am trying to loop through a recordset and issue a dos command to 
> > start a
> > service.  When I try to execute the code below, I get about 50 DOS windows
> > opening at the same time, can anyone advise if I can execute these 
> > commands
> > silently, and how can I capture the results?  All help is greatly
> > appreciated...
> >
> > Private Sub btnStartServices_Click()
> >
> >    Dim rs As DAO.Recordset
> >    Dim strServer, strService, strCommand As String
> >    Dim strQry As String
> >
> >    strQry = "qry01_StartServices"
> >
> >    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
> >    If rs.RecordCount = 0 Then MsgBox "No Records"
> >    With rs
> >        .MoveFirst
> >        Do
> >
> >        Set strServer = rs![Server]
> >        Set strService = rs![Service]
> >
> >        Me![nowStarting] = strServer & " - " & strService
> >        Me.Refresh
> >
> >        Set objShell = CreateObject("WScript.Shell")
> >        Set objExecObject = objShell.Exec("sc //" & strServer & " start " &
> > strService)
> >        MsgBox objExecObject.StdOut.ReadAll()
> >
> >        ' strCommand = "sc //" & strServer & " start " & strService
> >
> >        ' Shell strCommand
> >
> >        .MoveNext
> >        Loop Until .EOF
> >        .Close
> >    End With
> >    Set rst = Nothing
> >
> > End Sub
> >
> >
> 
> There are things you can do to hide the cmd window but they involve 3rd 
> party apps to do it. CMDOW is one that I've used in the past. I'd just use 
> WMI to start the services instead and not worry about the cmd windows. It 
> doesn't look like you're using SC.exe for anything but starting the services 
> and that can easily be done with WMI. Here are some examples of using WMI to 
> work with services. 
> http://www.computerperformance.co.uk/vbscript/wmi_services.htm
> 
> HTH
> 
> Matt 
> 
> 
> .
> 
0
Utf
2/5/2010 10:16:01 PM
"GLT" <GLT@discussions.microsoft.com> wrote in message 
news:5FB9FE67-67B5-49DB-9E27-712C7FA95379@microsoft.com...
> Hi Matt,
>
> Thanks for you reply and steering me in the right direction.
>
> I have modified my code and when I run it, I get the following error:
>
> Run-time error '-2147217385 (80041017)': Automation error
>
> which occurs on this line:
>
> For Each objService In colServices
>
> A copy of my code is below.  Does anyone know what is causing this?
>
> Any assistance is always greatly appreciated.
>
> Cheers,
> GLT.
>
> Private Sub btnStartServices_Click()
>
>    Dim rs As DAO.Recordset
>    Dim strServer, strService, strCommand As String
>    Dim strQry As String
>    Dim objWMIService As Object
>    Dim colServices As Object
>    Dim objService As Object
>    Dim errReturnCode As Long
>    Dim strErrorMessage As String
>
>    strQry = "qry01_StartServices"
>
>    errReturnCode = 9999
>
>    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
>    If rs.RecordCount = 0 Then MsgBox "No Records"
>    With rs
>        .MoveFirst
>        Do
>
>        strServer = "."
>        Set strService = rs![Service]
>
>        Set objWMIService = GetObject("winmgmts:" _
>        & "{impersonationLevel=impersonate}!\\" _
>        & strServer & "\root\cimv2")
>
>        Set colServices = objWMIService.ExecQuery _
>        ("SELECT * FROM Win32_Service" & _
>        " WHERE Name = '" & strService & "'")
>
>        Me![nowStarting] = strServer & " - " & strService
>        Me.Refresh
>
>        ' MsgBox (strServer & " - " & strService)
>
>        For Each objService In colServices
>            errReturnCode = objService.StartService()
>        Next
>
>        .MoveNext
>        Loop Until .EOF
>        .Close
>    End With
>    Set rs = Nothing
>
>      Select Case errReturnCode
>        Case Is = 0
>            MsgBox "Service " & strServiceName & " has been" & _
>                " started successfully.     ", vbInformation
>        Case Is = 9999
>            ' If errReturnCode has not changed the Service was not found
>            MsgBox "Service """ & strServiceName & """ was not found" & _
>                " and may not exist.       ", vbCritical
>        Case Else
>            ' Get the error messages supplied by Microsoft
>            strErrorMessage = strErrorMessage =
> ErrReturnStateChange(errReturnCode)
>            MsgBox "Service " & strServiceName _
>                & " change failed.     " & vbCrLf & "Reason: " _
>                & strErrorMessage & "        ", vbExclamation _
>                , "Service Change Failed"
>    End Select
>
> SetServiceState = errReturnCode
>
> Set objService = Nothing
> Set colServices = Nothing
> Set objWMIService = Nothing
>
>
> End Sub

It wouldn't surprise me if MS's WMI code fills colServices with a collection 
of Variants. Try declaring objService as Variant.


0
Stuart
2/6/2010 12:23:34 AM
Hi Stuart,

Thanks for your reply,

I tried changing it to Variant and it still stopped with the same error.

Any other ideas?

Cheers,
GT.

"Stuart McCall" wrote:

> "GLT" <GLT@discussions.microsoft.com> wrote in message 
> news:5FB9FE67-67B5-49DB-9E27-712C7FA95379@microsoft.com...
> > Hi Matt,
> >
> > Thanks for you reply and steering me in the right direction.
> >
> > I have modified my code and when I run it, I get the following error:
> >
> > Run-time error '-2147217385 (80041017)': Automation error
> >
> > which occurs on this line:
> >
> > For Each objService In colServices
> >
> > A copy of my code is below.  Does anyone know what is causing this?
> >
> > Any assistance is always greatly appreciated.
> >
> > Cheers,
> > GLT.
> >
> > Private Sub btnStartServices_Click()
> >
> >    Dim rs As DAO.Recordset
> >    Dim strServer, strService, strCommand As String
> >    Dim strQry As String
> >    Dim objWMIService As Object
> >    Dim colServices As Object
> >    Dim objService As Object
> >    Dim errReturnCode As Long
> >    Dim strErrorMessage As String
> >
> >    strQry = "qry01_StartServices"
> >
> >    errReturnCode = 9999
> >
> >    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
> >    If rs.RecordCount = 0 Then MsgBox "No Records"
> >    With rs
> >        .MoveFirst
> >        Do
> >
> >        strServer = "."
> >        Set strService = rs![Service]
> >
> >        Set objWMIService = GetObject("winmgmts:" _
> >        & "{impersonationLevel=impersonate}!\\" _
> >        & strServer & "\root\cimv2")
> >
> >        Set colServices = objWMIService.ExecQuery _
> >        ("SELECT * FROM Win32_Service" & _
> >        " WHERE Name = '" & strService & "'")
> >
> >        Me![nowStarting] = strServer & " - " & strService
> >        Me.Refresh
> >
> >        ' MsgBox (strServer & " - " & strService)
> >
> >        For Each objService In colServices
> >            errReturnCode = objService.StartService()
> >        Next
> >
> >        .MoveNext
> >        Loop Until .EOF
> >        .Close
> >    End With
> >    Set rs = Nothing
> >
> >      Select Case errReturnCode
> >        Case Is = 0
> >            MsgBox "Service " & strServiceName & " has been" & _
> >                " started successfully.     ", vbInformation
> >        Case Is = 9999
> >            ' If errReturnCode has not changed the Service was not found
> >            MsgBox "Service """ & strServiceName & """ was not found" & _
> >                " and may not exist.       ", vbCritical
> >        Case Else
> >            ' Get the error messages supplied by Microsoft
> >            strErrorMessage = strErrorMessage =
> > ErrReturnStateChange(errReturnCode)
> >            MsgBox "Service " & strServiceName _
> >                & " change failed.     " & vbCrLf & "Reason: " _
> >                & strErrorMessage & "        ", vbExclamation _
> >                , "Service Change Failed"
> >    End Select
> >
> > SetServiceState = errReturnCode
> >
> > Set objService = Nothing
> > Set colServices = Nothing
> > Set objWMIService = Nothing
> >
> >
> > End Sub
> 
> It wouldn't surprise me if MS's WMI code fills colServices with a collection 
> of Variants. Try declaring objService as Variant.
> 
> 
> .
> 
0
Utf
2/6/2010 1:28:01 AM
"GLT" <GLT@discussions.microsoft.com> wrote in message 
news:7A70A7B2-3CA1-42BA-924E-2A678646B788@microsoft.com...
> Hi Stuart,
>
> Thanks for your reply,
>
> I tried changing it to Variant and it still stopped with the same error.
>
> Any other ideas?

Nope. I've never had to use WMI so I've no experience to call on. I wuz just 
guessing.
Maybe someone else has an idea...

> Cheers,
> GT.
>
> "Stuart McCall" wrote:
>
>> "GLT" <GLT@discussions.microsoft.com> wrote in message
>> news:5FB9FE67-67B5-49DB-9E27-712C7FA95379@microsoft.com...
>> > Hi Matt,
>> >
>> > Thanks for you reply and steering me in the right direction.
>> >
>> > I have modified my code and when I run it, I get the following error:
>> >
>> > Run-time error '-2147217385 (80041017)': Automation error
>> >
>> > which occurs on this line:
>> >
>> > For Each objService In colServices
>> >
>> > A copy of my code is below.  Does anyone know what is causing this?
>> >
>> > Any assistance is always greatly appreciated.
>> >
>> > Cheers,
>> > GLT.
>> >
>> > Private Sub btnStartServices_Click()
>> >
>> >    Dim rs As DAO.Recordset
>> >    Dim strServer, strService, strCommand As String
>> >    Dim strQry As String
>> >    Dim objWMIService As Object
>> >    Dim colServices As Object
>> >    Dim objService As Object
>> >    Dim errReturnCode As Long
>> >    Dim strErrorMessage As String
>> >
>> >    strQry = "qry01_StartServices"
>> >
>> >    errReturnCode = 9999
>> >
>> >    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
>> >    If rs.RecordCount = 0 Then MsgBox "No Records"
>> >    With rs
>> >        .MoveFirst
>> >        Do
>> >
>> >        strServer = "."
>> >        Set strService = rs![Service]
>> >
>> >        Set objWMIService = GetObject("winmgmts:" _
>> >        & "{impersonationLevel=impersonate}!\\" _
>> >        & strServer & "\root\cimv2")
>> >
>> >        Set colServices = objWMIService.ExecQuery _
>> >        ("SELECT * FROM Win32_Service" & _
>> >        " WHERE Name = '" & strService & "'")
>> >
>> >        Me![nowStarting] = strServer & " - " & strService
>> >        Me.Refresh
>> >
>> >        ' MsgBox (strServer & " - " & strService)
>> >
>> >        For Each objService In colServices
>> >            errReturnCode = objService.StartService()
>> >        Next
>> >
>> >        .MoveNext
>> >        Loop Until .EOF
>> >        .Close
>> >    End With
>> >    Set rs = Nothing
>> >
>> >      Select Case errReturnCode
>> >        Case Is = 0
>> >            MsgBox "Service " & strServiceName & " has been" & _
>> >                " started successfully.     ", vbInformation
>> >        Case Is = 9999
>> >            ' If errReturnCode has not changed the Service was not found
>> >            MsgBox "Service """ & strServiceName & """ was not found" & 
>> > _
>> >                " and may not exist.       ", vbCritical
>> >        Case Else
>> >            ' Get the error messages supplied by Microsoft
>> >            strErrorMessage = strErrorMessage =
>> > ErrReturnStateChange(errReturnCode)
>> >            MsgBox "Service " & strServiceName _
>> >                & " change failed.     " & vbCrLf & "Reason: " _
>> >                & strErrorMessage & "        ", vbExclamation _
>> >                , "Service Change Failed"
>> >    End Select
>> >
>> > SetServiceState = errReturnCode
>> >
>> > Set objService = Nothing
>> > Set colServices = Nothing
>> > Set objWMIService = Nothing
>> >
>> >
>> > End Sub
>>
>> It wouldn't surprise me if MS's WMI code fills colServices with a 
>> collection
>> of Variants. Try declaring objService as Variant.
>>
>>
>> .
>> 


0
Stuart
2/6/2010 2:35:07 AM
Ok, finally worked this out and got it working.

The servive field contains the service display name, not the actual service 
name - so I need to modify the script that collects the Server related that 
is imported into my DB.  Once I change the service to the actual service 
name, all works well.  Copy of the code:

Private Sub btnStartServices_Click()

    On Error GoTo Err_btnStartServices

    Dim rs As DAO.Recordset
    Dim strServer, strService, strCommand As String
    Dim strQry As String
    Dim objWMIService As Object
    Dim colServices As Object
    Dim objService As Object
    Dim errReturnCode As Long
    Dim strErrorMessage As String
    Dim loopCount As Integer
       
    strQry = "qry01_StartServices"
    
    errReturnCode = 9999
     
    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
    If rs.RecordCount = 0 Then MsgBox "No Records"
    
    loopCount = 0
    
    With rs
        .MoveFirst
        Do
        
        strServer = rs![Server]
        strService = rs![Service]
        
        Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" 
& strServer & "\root\cimv2")
        Set colServices = oWMI.ExecQuery("Select * from Win32_Service Where 
Name ='" & strService & "'")
          
        Me![nowStarting] = loopCount & strServer & " - " & strService
        Me.Refresh
        
        For Each objService In colServices
            errReturnCode = objService.StartService()
        Next
         
        Select Case errReturnCode
        
        Case Is = 0
            MsgBox "Service " & strService & " has been" & _
                " started successfully.     ", vbInformation
        Case Is = 9999
            ' If errReturnCode has not changed the Service was not found
            MsgBox "Service """ & strService & """ was not found" & _
                " and may not exist.       ", vbCritical
        Case Else
            ' Get the error messages supplied by Microsoft
            strErrorMessage = strErrorMessage = 
ErrReturnStateChange(errReturnCode)
            MsgBox "Service " & strService _
                & " change failed.     " & vbCrLf & "Reason: " _
                & strErrorMessage & "        ", vbExclamation _
                , "Service Change Failed"
        End Select
        loopCount = loopCount + 1
        .MoveNext
        Loop Until .EOF
        .Close
    End With
    Set rs = Nothing
    
Err_btnStartServices:

SetServiceState = errReturnCode

MsgBox errReturnCode

Set objService = Nothing
Set colServices = Nothing
Set objWMIService = Nothing


End Sub

"GLT" wrote:

> Hi Stuart,
> 
> Thanks for your reply,
> 
> I tried changing it to Variant and it still stopped with the same error.
> 
> Any other ideas?
> 
> Cheers,
> GT.
> 
> "Stuart McCall" wrote:
> 
> > "GLT" <GLT@discussions.microsoft.com> wrote in message 
> > news:5FB9FE67-67B5-49DB-9E27-712C7FA95379@microsoft.com...
> > > Hi Matt,
> > >
> > > Thanks for you reply and steering me in the right direction.
> > >
> > > I have modified my code and when I run it, I get the following error:
> > >
> > > Run-time error '-2147217385 (80041017)': Automation error
> > >
> > > which occurs on this line:
> > >
> > > For Each objService In colServices
> > >
> > > A copy of my code is below.  Does anyone know what is causing this?
> > >
> > > Any assistance is always greatly appreciated.
> > >
> > > Cheers,
> > > GLT.
> > >
> > > Private Sub btnStartServices_Click()
> > >
> > >    Dim rs As DAO.Recordset
> > >    Dim strServer, strService, strCommand As String
> > >    Dim strQry As String
> > >    Dim objWMIService As Object
> > >    Dim colServices As Object
> > >    Dim objService As Object
> > >    Dim errReturnCode As Long
> > >    Dim strErrorMessage As String
> > >
> > >    strQry = "qry01_StartServices"
> > >
> > >    errReturnCode = 9999
> > >
> > >    Set rs = CurrentDb.OpenRecordset(strQry, dbOpenDynaset)
> > >    If rs.RecordCount = 0 Then MsgBox "No Records"
> > >    With rs
> > >        .MoveFirst
> > >        Do
> > >
> > >        strServer = "."
> > >        Set strService = rs![Service]
> > >
> > >        Set objWMIService = GetObject("winmgmts:" _
> > >        & "{impersonationLevel=impersonate}!\\" _
> > >        & strServer & "\root\cimv2")
> > >
> > >        Set colServices = objWMIService.ExecQuery _
> > >        ("SELECT * FROM Win32_Service" & _
> > >        " WHERE Name = '" & strService & "'")
> > >
> > >        Me![nowStarting] = strServer & " - " & strService
> > >        Me.Refresh
> > >
> > >        ' MsgBox (strServer & " - " & strService)
> > >
> > >        For Each objService In colServices
> > >            errReturnCode = objService.StartService()
> > >        Next
> > >
> > >        .MoveNext
> > >        Loop Until .EOF
> > >        .Close
> > >    End With
> > >    Set rs = Nothing
> > >
> > >      Select Case errReturnCode
> > >        Case Is = 0
> > >            MsgBox "Service " & strServiceName & " has been" & _
> > >                " started successfully.     ", vbInformation
> > >        Case Is = 9999
> > >            ' If errReturnCode has not changed the Service was not found
> > >            MsgBox "Service """ & strServiceName & """ was not found" & _
> > >                " and may not exist.       ", vbCritical
> > >        Case Else
> > >            ' Get the error messages supplied by Microsoft
> > >            strErrorMessage = strErrorMessage =
> > > ErrReturnStateChange(errReturnCode)
> > >            MsgBox "Service " & strServiceName _
> > >                & " change failed.     " & vbCrLf & "Reason: " _
> > >                & strErrorMessage & "        ", vbExclamation _
> > >                , "Service Change Failed"
> > >    End Select
> > >
> > > SetServiceState = errReturnCode
> > >
> > > Set objService = Nothing
> > > Set colServices = Nothing
> > > Set objWMIService = Nothing
> > >
> > >
> > > End Sub
> > 
> > It wouldn't surprise me if MS's WMI code fills colServices with a collection 
> > of Variants. Try declaring objService as Variant.
> > 
> > 
> > .
> > 
0
Utf
2/6/2010 2:53:01 AM
"GLT" <GLT@discussions.microsoft.com> wrote in message 
news:7389DCA3-6C55-4EB6-B8A0-072B196C25F0@microsoft.com...
> Ok, finally worked this out and got it working.

Great. I've saved a copy for future reference. Thanks for letting us know 
the solution.


0
Stuart
2/6/2010 3:46:52 AM
Reply:

Similar Artilces:

Need only one DLL instance to run...
Hi all, 1: if two apps load the same DLL - LoadLibrary(...) - system will create to different instance of the DLL... Now, in my DLL i've a CList and i need it to be visible to all instance and all apps!!!! Is there a way!? 2: I need the dll to remain loaded till machine reboot!!! Is it possible!? Thanks Ale >if two apps load the same DLL - LoadLibrary(...) - system will create to >different instance of the DLL... >Now, in my DLL i've a CList and i need it to be visible to all instance and >all apps!!!! > >Is there a way!? It'll be difficult to share a ...

RMS PO Window sizing, organization, label printing is (also) annoying (several suggestions made)
It never seems to fail that the PO window, whether in edit or receive mode is drawn poorly in terms of user need. Overall design is also sorely lacking, especially considering how much time Manager is used by retailers. For instance, the Item Description column is far too big for what RMS itself limits you to in terms of # of characters. The other columns are too wide also, which wastes prcious (PO window) space. The window itself is too narrow to accomodate all the columns, which is super annoying, plus there is no control over what columns do and don't display (boo!). And if you t...

credentials to run this report are not stored
Hi all, I'm getting this problem when I try and create a timed subscription. Error: ...credentials to run this report are not stored..... ok I created another folder under the same folder where I'm having this problem. loaded the report and I have no problem. I even moved the current folder with that report in it. Creted another folder with the same name and still the same problem with that named folder. With a different name for the folder I have no problem??? I'm stuck here.. almost all post just talk about storing the credentials, Already done and works...

run time error 10-22-03
I am having a lot of trouble when I open up word I get run time error 52 in VB. I have tried uninstalling word and reinstalling it. WE have tried deleting the macro but still to no avail can someone help me please? ...

Repost: Error running Report in an Access 2003 db from Access 2007
Ok, clarification - ignore the code from my original post, some of the reports do work. The ones that don't are reports that I have being filtered. Here is the code from one of those buttons: Private Sub Ok_Click() On Error GoTo Ok_Click_Err 'using the customer sub form for customer state report to filter the report, clicking ok will open report for selected state Dim stDocName As String Dim stLinkCriteria As String If Not IsNull(Me.Search_Results) Then stLinkCriteria = "[StateOrProvince] = """ & Me![Search Results] & """"...

Making a bubble charts without having the bubbles overlapping
Making a bubble charts without having the bubbles overlapping each other. Is this possible or not? If so how? If the bubbles are close and their size is greater than their spacing, they will overlap. You can change the relative size of bubbles in a chart by double clicking the series, clicking on the Options tab, and change the value where it says "Scale bubble size to ___% of default". - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "cindy" <cindy@discussions.microsof...

Automatically run macro
My name is Mike and i have a question about microsoft excel macro's. Attached is a copy of the excel sheet im working on. Below the excel sheet is the macro I built. Some of the cells contain given values and some cells are calculated from formulas. Cell (G4) is my given value...it is related to cell (C32). The point is, I plug a value into cell (C10) and it runs through the rest of the calcs in the other cells and gives me a value to cell (C32). I built a macro that works as a goal seek pretty much. The macro makes cell (C32) equal to cell (G4) and gives me the value for cell (C10). I wan...

Line Chart #7
I am using Excel 2000. I have a line chart that charts 4 sets of data, by month, for 1 year. I am using the 4th type sub chart type of line chart. My data points are OK except for the last point which is always down at "0" - the bottom of my chart. This causes, what I call a tail to hang down from the previous point to the bottom of my chart. I understand why this happens because there is no data for the next point. But I do not like the "tail" hanging down. If I only hi-lite the cells that have data, my chart looks like it only has 2 or 3 months. I can not ke...

Excel Continuous Running Total
I posted a message earlier and have received a partial solution. I want to keep track of how much stock prices go up or down with a running total of how much they go up or down over several days until the direction changes. For example, if price go up 10 on Mon, 20 on Tues, 30 on Thurs and down 10 on Fri I want my running total column to show a positive number of 60 and then a red number of 10 and continue adding the amount of the total of the down days until the market shows an up day. The formula I am now using total the first and second day but does not do a running total count if t...

display changing label caption on form as sub runs w/o screen flic
let's say i have this routine Sub Test label1.caption = "Starting ... " 'do events label1.caption = "Getting there ... " 'do events label1.caption = "Finished! ... " End Sub on my form, i have label1 right in the middle what happens is sometimes the message will change, and then sometimes it wont, or it will show the first one, skip the second and jump to the third etc etc etc so it is inconsistent. is there a way to make sure the label caption displays consistently, on time, wh...

when I try to bullet one line, all bullets for every line
When I type a paragraph and want to indent with a bullet., the entire paragraph is automatically bulleted and goes to a single spacing. I tried turning off bullet in the options but it still doesn't work. I repaired Office and it still does the same thing. ...

Locate a cell, based on a criteria, then use the 'Cell' command...
I am using a pivot table to configure some data. In the first column, the pivot table of course displays only one instance of the text representing of data group. What I need to do is determine in which cell a particular item of text (i.e. the criteria) resides in. Once I can locate the cell where my 'criteria' text string resides, I can then use the CELL function to return the row number. My question is... what excel formula can I use to locate a cell in a single column range, where the cell contains the text = "XYZ" My eventual plan is to then use the following ...

how to set up for the Windows Mail??
anyone can tell me by how i can set up the email account, checking with the Windows Mail?? Windows Mail: Setting up an account from start to finish http://windows.microsoft.com/en-US/windows-vista/Windows-Mail-setting-up-an-account-from-start-to-finish -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "JuniorBoy" <JuniorBoy@discussions.microsoft.com> wrote in message news:30E1D13E-3A13-493F-95DC-AE5FE645B6EF@microsoft.com... > anyone can tell me by how i can set up the email account, checking with > the > Windows Mail?? ...

Money 2002 will not run
I had been using Money 2002 for approx. 3 yrs on my home pc (Dell Dim 2100, XP Home Ed. w/SP2). Last year, it simply would not launch. No error message, no splash screen, no app opening, no process listed in Task Manager. Just.... nothing.... The only change that was made to the system since M2k2 last ran was upgrading my a/v solution from Trend Micro PC-Cillin to TM Internet Security. I have tried disabling every aspect of the Internet Security product, as well as completely un-installing the app, and then attempting to run Money, but the same thing (nothing) happens. I was considerin...

Windows Vista & Publisher Font problems
Two problems: 1. I created a document on a computer with MS PUblisher 2003 and windows xp using a font called Aquiline Two. I try to open this file on my Windows Vista computer using MSPUB 2003 and the font does not display at all. I installed it to the fonts folder, restarted, still wont display. I cant even use the font in any publisher program. I can however, use it in word and other programs on my vista computer. Is there anyway I can get this file to work?? 2. another font issue with Windows Vista using font TSP of the mourning. When i open files created on an XP computer on my vi...

Re: Workflow just wont run automatically, i have to run them manually
Yes, but i realized what i was doing wrong. I assumed [bad idea] that if i create a case and hit Save & Close the first time, taht the rule will run. In order for the rule to run automatically, it has to be Save, once it saves it, then Save & Close. Thanks for your reply. "Hi, Did you check the workflow monitor to see if the rules get triggered correctly and complete sucessfully ? Have a nice day, St=E9phane Dorrekens " --------------= Posted using GrabIt =---------------- ------= Binary Usenet downloading made easy =--------- -= Get GrabIt for free from http://...

Outlook Still Running
I am running XP Pro with Office 2003 Pro and sometimes when I exit out of Outlook, Outlook.exe and Winword.exe stay as processes still running. Does anyone else have this problem and what can do to make sure this does not happen? Thanks for your help -- Neil Remove ABCD from Email address to reply <neil154ABCD@earthlink.net> wrote: > I am running XP Pro with Office 2003 Pro and sometimes when I exit > out of Outlook, Outlook.exe and Winword.exe stay as processes still > running. Does anyone else have this problem and what can do to make > sure this does not happ...

CEditCtrl with automatic line feed
Hello NG, I hope someone can help. I already have been searching in the web but without success. I use a CEditCtrl, in which one can input several lines. When the input reaches the border, I want the text to "jump" into the next line, so that the user is not supposed to scroll (like here in my mail editor e.g.). Do you know if such a EditCtrl exists or how I can do it? Thanks in advance Guido "Guido Franzke" <guidof73@yahoo.de> wrote in message news:eZcKcnTbHHA.4720@TK2MSFTNGP04.phx.gbl... > Hello NG, > > I hope someone can help. I already have been se...

Very strange problems while running Great Plains on workstations
I notice that a few workstations in an office I support are having problems when they run Great Plains. Excel, Outlook, Word and Dynamics.exe are showing in the Application event log as being Hanging or Faulting. I also see Fault Bucket errors, but when I search online I cannot find any information online. Here is one of the Fault Bucket errors: 3:15:35 pm 28-Sep-06 Application Hang None 1001 N/A Fault bucket 296734104. Also, these workstations are experiencing problems printing PDF files. Has anyone out there seen this behavior and if so, how can these problems be fixed? Thank you, ...

0x800C0002 error EVERY time i try windows update
hi im trying to update my older laptop with windows 2000 sp4. and i keep getting the 0x800C0002 error. I have done everything it said to do (delete temp. internet files, refresh, close and reopen ie) and i even tryed safe mode with networking and it still didnt work. Our Vista laptop updates without a problem. Anyone know why? One5860 Full sys. Specs. Windows 2000 sp4 384 mb ram Trident Cyberblade AGP 8mb vram 1.0 ghz P3 CPU 0x800C0002 - Inet_E_Invalid_URL Maybe the server is busy and you are redirect to a wrong URL Wait a few hours and retry it, One5860. G...

Publisher 2000 will not run
I had problems with Publisher 98 not running which we=20 never did solve so I installed office 2000 to see if=20 Publisher 2000 would function. Same problem: The flash=20 screen pops up and then disappears. No program. Microsoft=AE Publisher 2000 Version 6.0 has encountered a=20 problem and needs to close. We are sorry for the=20 inconvenience. Howard, hi again, Have you tried opening Publisher in safe mode? Publisher retains all printer information within its publications. If you can open Publisher in safe mode, either regress or update your printer and video drivers. -- Mary Sauer MS MV...

Q: How to prevent help from moving my windows around?
I'm using Outlook 2000, on Microsoft Windows 2000 [Version 5.00.2195], and also the Visual Basic environment for making macros for outlook. When I open the visual basic help then the help system rearranges my basic and outlook windows. And then if I move the help windows then the outlook windows and visual basic windows also rearange themselves on my screen. Does anyone know how to stop this from happening, and if so, how? Thanks, malcolm. Do you have the help window undocked? drag it away from the screen edge to undock it. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself...

Macro automatic run at open
Is there a simple way to have a macro automatically started when a workbook is open? Thanks Francesco Francesco, use the workbook open event, like this, Private Sub Workbook_Open() MsgBox "It Works!" End Sub To put in this macro, from your workbook right-click the workbook's icon and pick View Code. This icon is at the top-left of the spreadsheet this will open the VBA editor to the thisworkbook module, then, paste the code in the window that opens on the right hand side, press Alt and Q to close this window and go back to your workbook, now this will run every time you ...

OL07 keyboard "short"cuts in the Message Window?
In OL03, I was able to change the account to send a message with Alt+N followed by the number. Now, it seems, the shortcut is Alt+H,Y,1 followed by the number. Similarly, to send a message, I would use Alt+S. Now I have the choice of Alt+H,S or Alt+F,E. (Or Ctl-ENTER, I suppose.) Is there anything I can do to make OL07 use shorter shortcuts? Alt+S should still work... -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook ...

Running diferent query with one command
I would like to run queries with just one botton and a date dispalyed in a form. If Sunday March 09, 2008, is dispalyed I would like to click on a button and run a query that will select emloyees that are scheduled to work on this day of the week along with other pertinent information already preselected by that query. Currenlty I am using 7 diferrent buttons to run 7 differnrent append queries but it is too confusing and I am sure there is an better way. Thanks Charles -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200803/1 Why 7 butt...