+ Reply to Thread
Results 1 to 10 of 10

Need to make a vbs, but dont know how....

  1. #1
    Duncan
    Guest

    Need to make a vbs, but dont know how....

    Hello All,

    I need to create a VBS that will change the setting in excel (ignore
    other applications) to false, but I dont really know how to do this.

    I have played around with a .inf file someone posted on here but cannot
    get that to work either....it says installation failed..(ill put it
    below, in case it can be changed to make it work but I dont know how to
    do that either!)


    ' [Version]
    Signature=$CHICAGO$


    ' [DefaultInstall]
    BitReg=Bit.Settings


    ' [Bit.Settings]
    HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0


    (the above is exactly as I have it, i put the commas in because thats
    what I thought was going wrong, but apparantly not.

    Any help at all would be much appreciated.

    Duncan


  2. #2
    John.Greenan
    Guest

    RE: Need to make a vbs, but dont know how....

    A few questions:
    What setting do you want to change in Excel?
    Do you want to create a VBScript? [Note - vbscript is nothing to do with
    Excel and the vba language that Excel uses]

    Post back with some answers and I'll try to help

    --
    www.alignment-systems.com


    "Duncan" wrote:

    > Hello All,
    >
    > I need to create a VBS that will change the setting in excel (ignore
    > other applications) to false, but I dont really know how to do this.
    >
    > I have played around with a .inf file someone posted on here but cannot
    > get that to work either....it says installation failed..(ill put it
    > below, in case it can be changed to make it work but I dont know how to
    > do that either!)
    >
    >
    > ' [Version]
    > Signature=$CHICAGO$
    >
    >
    > ' [DefaultInstall]
    > BitReg=Bit.Settings
    >
    >
    > ' [Bit.Settings]
    > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    >
    >
    > (the above is exactly as I have it, i put the commas in because thats
    > what I thought was going wrong, but apparantly not.
    >
    > Any help at all would be much appreciated.
    >
    > Duncan
    >
    >


  3. #3
    John.Greenan
    Guest

    RE: Need to make a vbs, but dont know how....

    A few questions:
    What setting do you want to change in Excel?
    Do you want to create a VBScript? [Note - vbscript is nothing to do with
    Excel and the vba language that Excel uses]

    Post back with some answers and I'll try to help

    --
    www.alignment-systems.com


    "Duncan" wrote:

    > Hello All,
    >
    > I need to create a VBS that will change the setting in excel (ignore
    > other applications) to false, but I dont really know how to do this.
    >
    > I have played around with a .inf file someone posted on here but cannot
    > get that to work either....it says installation failed..(ill put it
    > below, in case it can be changed to make it work but I dont know how to
    > do that either!)
    >
    >
    > ' [Version]
    > Signature=$CHICAGO$
    >
    >
    > ' [DefaultInstall]
    > BitReg=Bit.Settings
    >
    >
    > ' [Bit.Settings]
    > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    >
    >
    > (the above is exactly as I have it, i put the commas in because thats
    > what I thought was going wrong, but apparantly not.
    >
    > Any help at all would be much appreciated.
    >
    > Duncan
    >
    >


  4. #4
    Duncan
    Guest

    Re: Need to make a vbs, but dont know how....

    Setting: application.ignoreremoterequests = false

    VBScript: yes, because if i do it simply via a macro then users wouldnt
    be able to perform this by clicking on a shortcut, cos it wouldnt load
    the shortcut up with the setting set to true so catch 22 situation!

    Q: I didnt know vbscript was different to vba, just thought it was a
    differant version of the same thing because the commands appeared
    similar to me....shows my ignorance really doesnt it!

    Any help would be much appreciated.

    Duncan




    John.Greenan wrote:

    > A few questions:
    > What setting do you want to change in Excel?
    > Do you want to create a VBScript? [Note - vbscript is nothing to do with
    > Excel and the vba language that Excel uses]
    >
    > Post back with some answers and I'll try to help
    >
    > --
    > www.alignment-systems.com
    >
    >
    > "Duncan" wrote:
    >
    > > Hello All,
    > >
    > > I need to create a VBS that will change the setting in excel (ignore
    > > other applications) to false, but I dont really know how to do this.
    > >
    > > I have played around with a .inf file someone posted on here but cannot
    > > get that to work either....it says installation failed..(ill put it
    > > below, in case it can be changed to make it work but I dont know how to
    > > do that either!)
    > >
    > >
    > > ' [Version]
    > > Signature=$CHICAGO$
    > >
    > >
    > > ' [DefaultInstall]
    > > BitReg=Bit.Settings
    > >
    > >
    > > ' [Bit.Settings]
    > > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    > >
    > >
    > > (the above is exactly as I have it, i put the commas in because thats
    > > what I thought was going wrong, but apparantly not.
    > >
    > > Any help at all would be much appreciated.
    > >
    > > Duncan
    > >
    > >



  5. #5
    John.Greenan
    Guest

    Re: Need to make a vbs, but dont know how....

    Ok, so create a script like this (I am not using an editor, so you'll have to
    verify the syntax yourself)

    --------------------------------------------------------------------------------
    Dim myExcelApplication

    set myExcelApplication = GetObject("Excel.Application")

    myExcelApplication.ignoreremoterequests = false

    myExcelApplication.quit
    set myExcelApplication = nothing
    --------------------------------------------------------------------------------

    Have a go with that...

    If this helps then please mark the reply as helpful




    --
    www.alignment-systems.com


    "Duncan" wrote:

    > Setting: application.ignoreremoterequests = false
    >
    > VBScript: yes, because if i do it simply via a macro then users wouldnt
    > be able to perform this by clicking on a shortcut, cos it wouldnt load
    > the shortcut up with the setting set to true so catch 22 situation!
    >
    > Q: I didnt know vbscript was different to vba, just thought it was a
    > differant version of the same thing because the commands appeared
    > similar to me....shows my ignorance really doesnt it!
    >
    > Any help would be much appreciated.
    >
    > Duncan
    >
    >
    >
    >
    > John.Greenan wrote:
    >
    > > A few questions:
    > > What setting do you want to change in Excel?
    > > Do you want to create a VBScript? [Note - vbscript is nothing to do with
    > > Excel and the vba language that Excel uses]
    > >
    > > Post back with some answers and I'll try to help
    > >
    > > --
    > > www.alignment-systems.com
    > >
    > >
    > > "Duncan" wrote:
    > >
    > > > Hello All,
    > > >
    > > > I need to create a VBS that will change the setting in excel (ignore
    > > > other applications) to false, but I dont really know how to do this.
    > > >
    > > > I have played around with a .inf file someone posted on here but cannot
    > > > get that to work either....it says installation failed..(ill put it
    > > > below, in case it can be changed to make it work but I dont know how to
    > > > do that either!)
    > > >
    > > >
    > > > ' [Version]
    > > > Signature=$CHICAGO$
    > > >
    > > >
    > > > ' [DefaultInstall]
    > > > BitReg=Bit.Settings
    > > >
    > > >
    > > > ' [Bit.Settings]
    > > > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    > > >
    > > >
    > > > (the above is exactly as I have it, i put the commas in because thats
    > > > what I thought was going wrong, but apparantly not.
    > > >
    > > > Any help at all would be much appreciated.
    > > >
    > > > Duncan
    > > >
    > > >

    >
    >


  6. #6
    Duncan
    Guest

    Re: Need to make a vbs, but dont know how....

    John / Anyone,

    Im not really sure that I can verify the syntax and im getting a syntax
    error on line 2.

    I dont think I have a vbscript editor, I usually use notepad, but I
    pasted it into Excel vba and it didnt show up red.

    Confused........

    Can you advise any further?

    Duncan


    John.Greenan wrote:

    > Ok, so create a script like this (I am not using an editor, so you'll have to
    > verify the syntax yourself)
    >
    > --------------------------------------------------------------------------------
    > Dim myExcelApplication
    >
    > set myExcelApplication = GetObject("Excel.Application")
    >
    > myExcelApplication.ignoreremoterequests = false
    >
    > myExcelApplication.quit
    > set myExcelApplication = nothing
    > --------------------------------------------------------------------------------
    >
    > Have a go with that...
    >
    > If this helps then please mark the reply as helpful
    >
    >
    >
    >
    > --
    > www.alignment-systems.com
    >
    >
    > "Duncan" wrote:
    >
    > > Setting: application.ignoreremoterequests = false
    > >
    > > VBScript: yes, because if i do it simply via a macro then users wouldnt
    > > be able to perform this by clicking on a shortcut, cos it wouldnt load
    > > the shortcut up with the setting set to true so catch 22 situation!
    > >
    > > Q: I didnt know vbscript was different to vba, just thought it was a
    > > differant version of the same thing because the commands appeared
    > > similar to me....shows my ignorance really doesnt it!
    > >
    > > Any help would be much appreciated.
    > >
    > > Duncan
    > >
    > >
    > >
    > >
    > > John.Greenan wrote:
    > >
    > > > A few questions:
    > > > What setting do you want to change in Excel?
    > > > Do you want to create a VBScript? [Note - vbscript is nothing to do with
    > > > Excel and the vba language that Excel uses]
    > > >
    > > > Post back with some answers and I'll try to help
    > > >
    > > > --
    > > > www.alignment-systems.com
    > > >
    > > >
    > > > "Duncan" wrote:
    > > >
    > > > > Hello All,
    > > > >
    > > > > I need to create a VBS that will change the setting in excel (ignore
    > > > > other applications) to false, but I dont really know how to do this.
    > > > >
    > > > > I have played around with a .inf file someone posted on here but cannot
    > > > > get that to work either....it says installation failed..(ill put it
    > > > > below, in case it can be changed to make it work but I dont know how to
    > > > > do that either!)
    > > > >
    > > > >
    > > > > ' [Version]
    > > > > Signature=$CHICAGO$
    > > > >
    > > > >
    > > > > ' [DefaultInstall]
    > > > > BitReg=Bit.Settings
    > > > >
    > > > >
    > > > > ' [Bit.Settings]
    > > > > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    > > > >
    > > > >
    > > > > (the above is exactly as I have it, i put the commas in because thats
    > > > > what I thought was going wrong, but apparantly not.
    > > > >
    > > > > Any help at all would be much appreciated.
    > > > >
    > > > > Duncan
    > > > >
    > > > >

    > >
    > >



  7. #7
    Duncan
    Guest

    Re: Need to make a vbs, but dont know how....

    I have just changed line 2, it now looks like:

    Dim myExcelApplication
    Set XLSA = GetObject(, "Excel.Application")
    XLSA.IgnoreRemoteRequests = False
    XLSA.Quit
    Set XLSA = Nothing

    And now it gives the answer, "activex component cannot create object"

    .....I have very limited knowledge of vbs files, it worked when I ran it
    through a macro....

    Duncan



    Duncan wrote:

    > John / Anyone,
    >
    > Im not really sure that I can verify the syntax and im getting a syntax
    > error on line 2.
    >
    > I dont think I have a vbscript editor, I usually use notepad, but I
    > pasted it into Excel vba and it didnt show up red.
    >
    > Confused........
    >
    > Can you advise any further?
    >
    > Duncan
    >
    >
    > John.Greenan wrote:
    >
    > > Ok, so create a script like this (I am not using an editor, so you'll have to
    > > verify the syntax yourself)
    > >
    > > --------------------------------------------------------------------------------
    > > Dim myExcelApplication
    > >
    > > set myExcelApplication = GetObject("Excel.Application")
    > >
    > > myExcelApplication.ignoreremoterequests = false
    > >
    > > myExcelApplication.quit
    > > set myExcelApplication = nothing
    > > --------------------------------------------------------------------------------
    > >
    > > Have a go with that...
    > >
    > > If this helps then please mark the reply as helpful
    > >
    > >
    > >
    > >
    > > --
    > > www.alignment-systems.com
    > >
    > >
    > > "Duncan" wrote:
    > >
    > > > Setting: application.ignoreremoterequests = false
    > > >
    > > > VBScript: yes, because if i do it simply via a macro then users wouldnt
    > > > be able to perform this by clicking on a shortcut, cos it wouldnt load
    > > > the shortcut up with the setting set to true so catch 22 situation!
    > > >
    > > > Q: I didnt know vbscript was different to vba, just thought it was a
    > > > differant version of the same thing because the commands appeared
    > > > similar to me....shows my ignorance really doesnt it!
    > > >
    > > > Any help would be much appreciated.
    > > >
    > > > Duncan
    > > >
    > > >
    > > >
    > > >
    > > > John.Greenan wrote:
    > > >
    > > > > A few questions:
    > > > > What setting do you want to change in Excel?
    > > > > Do you want to create a VBScript? [Note - vbscript is nothing to do with
    > > > > Excel and the vba language that Excel uses]
    > > > >
    > > > > Post back with some answers and I'll try to help
    > > > >
    > > > > --
    > > > > www.alignment-systems.com
    > > > >
    > > > >
    > > > > "Duncan" wrote:
    > > > >
    > > > > > Hello All,
    > > > > >
    > > > > > I need to create a VBS that will change the setting in excel (ignore
    > > > > > other applications) to false, but I dont really know how to do this.
    > > > > >
    > > > > > I have played around with a .inf file someone posted on here but cannot
    > > > > > get that to work either....it says installation failed..(ill put it
    > > > > > below, in case it can be changed to make it work but I dont know how to
    > > > > > do that either!)
    > > > > >
    > > > > >
    > > > > > ' [Version]
    > > > > > Signature=$CHICAGO$
    > > > > >
    > > > > >
    > > > > > ' [DefaultInstall]
    > > > > > BitReg=Bit.Settings
    > > > > >
    > > > > >
    > > > > > ' [Bit.Settings]
    > > > > > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    > > > > >
    > > > > >
    > > > > > (the above is exactly as I have it, i put the commas in because thats
    > > > > > what I thought was going wrong, but apparantly not.
    > > > > >
    > > > > > Any help at all would be much appreciated.
    > > > > >
    > > > > > Duncan
    > > > > >
    > > > > >
    > > >
    > > >



  8. #8
    NickHK
    Guest

    Re: Need to make a vbs, but dont know how....

    If Excel is not already running, GetObject will fail. maybe you need
    CreateObject.
    Also, if you set this to false, you know that a new instance of Excel will
    be created if a user opens an .xls from Explorer, as this uses DDE.
    Is that your aim ?
    It will have no effect on COM calls, as with GetObject etc.

    NickHK

    "Duncan" <duncan.mutchblache@googlemail.com> wrote in message
    news:1152777385.891761.53120@m73g2000cwd.googlegroups.com...
    > I have just changed line 2, it now looks like:
    >
    > Dim myExcelApplication
    > Set XLSA = GetObject(, "Excel.Application")
    > XLSA.IgnoreRemoteRequests = False
    > XLSA.Quit
    > Set XLSA = Nothing
    >
    > And now it gives the answer, "activex component cannot create object"
    >
    > ....I have very limited knowledge of vbs files, it worked when I ran it
    > through a macro....
    >
    > Duncan
    >
    >
    >
    > Duncan wrote:
    >
    > > John / Anyone,
    > >
    > > Im not really sure that I can verify the syntax and im getting a syntax
    > > error on line 2.
    > >
    > > I dont think I have a vbscript editor, I usually use notepad, but I
    > > pasted it into Excel vba and it didnt show up red.
    > >
    > > Confused........
    > >
    > > Can you advise any further?
    > >
    > > Duncan
    > >
    > >
    > > John.Greenan wrote:
    > >
    > > > Ok, so create a script like this (I am not using an editor, so you'll

    have to
    > > > verify the syntax yourself)
    > > >

    > >

    > --------------------------------------------------------------------------

    ------
    > > > Dim myExcelApplication
    > > >
    > > > set myExcelApplication = GetObject("Excel.Application")
    > > >
    > > > myExcelApplication.ignoreremoterequests = false
    > > >
    > > > myExcelApplication.quit
    > > > set myExcelApplication = nothing

    > >

    > --------------------------------------------------------------------------

    ------
    > > >
    > > > Have a go with that...
    > > >
    > > > If this helps then please mark the reply as helpful
    > > >
    > > >
    > > >
    > > >
    > > > --
    > > > www.alignment-systems.com
    > > >
    > > >
    > > > "Duncan" wrote:
    > > >
    > > > > Setting: application.ignoreremoterequests = false
    > > > >
    > > > > VBScript: yes, because if i do it simply via a macro then users

    wouldnt
    > > > > be able to perform this by clicking on a shortcut, cos it wouldnt

    load
    > > > > the shortcut up with the setting set to true so catch 22 situation!
    > > > >
    > > > > Q: I didnt know vbscript was different to vba, just thought it was a
    > > > > differant version of the same thing because the commands appeared
    > > > > similar to me....shows my ignorance really doesnt it!
    > > > >
    > > > > Any help would be much appreciated.
    > > > >
    > > > > Duncan
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > John.Greenan wrote:
    > > > >
    > > > > > A few questions:
    > > > > > What setting do you want to change in Excel?
    > > > > > Do you want to create a VBScript? [Note - vbscript is nothing to

    do with
    > > > > > Excel and the vba language that Excel uses]
    > > > > >
    > > > > > Post back with some answers and I'll try to help
    > > > > >
    > > > > > --
    > > > > > www.alignment-systems.com
    > > > > >
    > > > > >
    > > > > > "Duncan" wrote:
    > > > > >
    > > > > > > Hello All,
    > > > > > >
    > > > > > > I need to create a VBS that will change the setting in excel

    (ignore
    > > > > > > other applications) to false, but I dont really know how to do

    this.
    > > > > > >
    > > > > > > I have played around with a .inf file someone posted on here but

    cannot
    > > > > > > get that to work either....it says installation failed..(ill put

    it
    > > > > > > below, in case it can be changed to make it work but I dont know

    how to
    > > > > > > do that either!)
    > > > > > >
    > > > > > >
    > > > > > > ' [Version]
    > > > > > > Signature=$CHICAGO$
    > > > > > >
    > > > > > >
    > > > > > > ' [DefaultInstall]
    > > > > > > BitReg=Bit.Settings
    > > > > > >
    > > > > > >
    > > > > > > ' [Bit.Settings]
    > > > > > >

    HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    > > > > > >
    > > > > > >
    > > > > > > (the above is exactly as I have it, i put the commas in because

    thats
    > > > > > > what I thought was going wrong, but apparantly not.
    > > > > > >
    > > > > > > Any help at all would be much appreciated.
    > > > > > >
    > > > > > > Duncan
    > > > > > >
    > > > > > >
    > > > >
    > > > >

    >




  9. #9
    Duncan
    Guest

    Re: Need to make a vbs, but dont know how....

    Nick,

    My aim is solely to have something that will change the setting to
    false because one of our problematic programs will leave this setting
    at true sometimes when it crashes, What I wanted to do was leave a file
    that they could just double click and fix it becase all the user will
    know is "My spreadsheet wont open anymore..." and we can say "If excel
    doesnt open then try double clicking this file first and then try
    opening again before you cry for help"

    I dont understand very much at all, perhaps you could suggest
    something?, Im going to try changing the vbs to "CreateObject" and see
    if that works....

    Duncan



    NickHK wrote:

    > If Excel is not already running, GetObject will fail. maybe you need
    > CreateObject.
    > Also, if you set this to false, you know that a new instance of Excel will
    > be created if a user opens an .xls from Explorer, as this uses DDE.
    > Is that your aim ?
    > It will have no effect on COM calls, as with GetObject etc.
    >
    > NickHK
    >
    > "Duncan" <duncan.mutchblache@googlemail.com> wrote in message
    > news:1152777385.891761.53120@m73g2000cwd.googlegroups.com...
    > > I have just changed line 2, it now looks like:
    > >
    > > Dim myExcelApplication
    > > Set XLSA = GetObject(, "Excel.Application")
    > > XLSA.IgnoreRemoteRequests = False
    > > XLSA.Quit
    > > Set XLSA = Nothing
    > >
    > > And now it gives the answer, "activex component cannot create object"
    > >
    > > ....I have very limited knowledge of vbs files, it worked when I ran it
    > > through a macro....
    > >
    > > Duncan
    > >
    > >
    > >
    > > Duncan wrote:
    > >
    > > > John / Anyone,
    > > >
    > > > Im not really sure that I can verify the syntax and im getting a syntax
    > > > error on line 2.
    > > >
    > > > I dont think I have a vbscript editor, I usually use notepad, but I
    > > > pasted it into Excel vba and it didnt show up red.
    > > >
    > > > Confused........
    > > >
    > > > Can you advise any further?
    > > >
    > > > Duncan
    > > >
    > > >
    > > > John.Greenan wrote:
    > > >
    > > > > Ok, so create a script like this (I am not using an editor, so you'll

    > have to
    > > > > verify the syntax yourself)
    > > > >
    > > >

    > > --------------------------------------------------------------------------

    > ------
    > > > > Dim myExcelApplication
    > > > >
    > > > > set myExcelApplication = GetObject("Excel.Application")
    > > > >
    > > > > myExcelApplication.ignoreremoterequests = false
    > > > >
    > > > > myExcelApplication.quit
    > > > > set myExcelApplication = nothing
    > > >

    > > --------------------------------------------------------------------------

    > ------
    > > > >
    > > > > Have a go with that...
    > > > >
    > > > > If this helps then please mark the reply as helpful
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > --
    > > > > www.alignment-systems.com
    > > > >
    > > > >
    > > > > "Duncan" wrote:
    > > > >
    > > > > > Setting: application.ignoreremoterequests = false
    > > > > >
    > > > > > VBScript: yes, because if i do it simply via a macro then users

    > wouldnt
    > > > > > be able to perform this by clicking on a shortcut, cos it wouldnt

    > load
    > > > > > the shortcut up with the setting set to true so catch 22 situation!
    > > > > >
    > > > > > Q: I didnt know vbscript was different to vba, just thought it was a
    > > > > > differant version of the same thing because the commands appeared
    > > > > > similar to me....shows my ignorance really doesnt it!
    > > > > >
    > > > > > Any help would be much appreciated.
    > > > > >
    > > > > > Duncan
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > > John.Greenan wrote:
    > > > > >
    > > > > > > A few questions:
    > > > > > > What setting do you want to change in Excel?
    > > > > > > Do you want to create a VBScript? [Note - vbscript is nothing to

    > do with
    > > > > > > Excel and the vba language that Excel uses]
    > > > > > >
    > > > > > > Post back with some answers and I'll try to help
    > > > > > >
    > > > > > > --
    > > > > > > www.alignment-systems.com
    > > > > > >
    > > > > > >
    > > > > > > "Duncan" wrote:
    > > > > > >
    > > > > > > > Hello All,
    > > > > > > >
    > > > > > > > I need to create a VBS that will change the setting in excel

    > (ignore
    > > > > > > > other applications) to false, but I dont really know how to do

    > this.
    > > > > > > >
    > > > > > > > I have played around with a .inf file someone posted on here but

    > cannot
    > > > > > > > get that to work either....it says installation failed..(ill put

    > it
    > > > > > > > below, in case it can be changed to make it work but I dont know

    > how to
    > > > > > > > do that either!)
    > > > > > > >
    > > > > > > >
    > > > > > > > ' [Version]
    > > > > > > > Signature=$CHICAGO$
    > > > > > > >
    > > > > > > >
    > > > > > > > ' [DefaultInstall]
    > > > > > > > BitReg=Bit.Settings
    > > > > > > >
    > > > > > > >
    > > > > > > > ' [Bit.Settings]
    > > > > > > >

    > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    > > > > > > >
    > > > > > > >
    > > > > > > > (the above is exactly as I have it, i put the commas in because

    > thats
    > > > > > > > what I thought was going wrong, but apparantly not.
    > > > > > > >
    > > > > > > > Any help at all would be much appreciated.
    > > > > > > >
    > > > > > > > Duncan
    > > > > > > >
    > > > > > > >
    > > > > >
    > > > > >

    > >



  10. #10
    Duncan
    Guest

    Re: Need to make a vbs, but dont know how....

    Nick,

    Ignore my last post, I got it work with your suggestion. Many Many
    thanks! (its been bugging me for days now)

    The VBScript file just has this code:

    Dim myExcelApplication
    Set XLSA = CreateObject("excel.application")
    XLSA.IgnoreRemoteRequests = False
    XLSA.Quit
    Set XLSA = Nothing

    If I put this in the server startup directory then the problem should
    never ever arise again.

    Many thanks to you both for your help.

    Duncan


    Duncan wrote:

    > Nick,
    >
    > My aim is solely to have something that will change the setting to
    > false because one of our problematic programs will leave this setting
    > at true sometimes when it crashes, What I wanted to do was leave a file
    > that they could just double click and fix it becase all the user will
    > know is "My spreadsheet wont open anymore..." and we can say "If excel
    > doesnt open then try double clicking this file first and then try
    > opening again before you cry for help"
    >
    > I dont understand very much at all, perhaps you could suggest
    > something?, Im going to try changing the vbs to "CreateObject" and see
    > if that works....
    >
    > Duncan
    >
    >
    >
    > NickHK wrote:
    >
    > > If Excel is not already running, GetObject will fail. maybe you need
    > > CreateObject.
    > > Also, if you set this to false, you know that a new instance of Excel will
    > > be created if a user opens an .xls from Explorer, as this uses DDE.
    > > Is that your aim ?
    > > It will have no effect on COM calls, as with GetObject etc.
    > >
    > > NickHK
    > >
    > > "Duncan" <duncan.mutchblache@googlemail.com> wrote in message
    > > news:1152777385.891761.53120@m73g2000cwd.googlegroups.com...
    > > > I have just changed line 2, it now looks like:
    > > >
    > > > Dim myExcelApplication
    > > > Set XLSA = GetObject(, "Excel.Application")
    > > > XLSA.IgnoreRemoteRequests = False
    > > > XLSA.Quit
    > > > Set XLSA = Nothing
    > > >
    > > > And now it gives the answer, "activex component cannot create object"
    > > >
    > > > ....I have very limited knowledge of vbs files, it worked when I ran it
    > > > through a macro....
    > > >
    > > > Duncan
    > > >
    > > >
    > > >
    > > > Duncan wrote:
    > > >
    > > > > John / Anyone,
    > > > >
    > > > > Im not really sure that I can verify the syntax and im getting a syntax
    > > > > error on line 2.
    > > > >
    > > > > I dont think I have a vbscript editor, I usually use notepad, but I
    > > > > pasted it into Excel vba and it didnt show up red.
    > > > >
    > > > > Confused........
    > > > >
    > > > > Can you advise any further?
    > > > >
    > > > > Duncan
    > > > >
    > > > >
    > > > > John.Greenan wrote:
    > > > >
    > > > > > Ok, so create a script like this (I am not using an editor, so you'll

    > > have to
    > > > > > verify the syntax yourself)
    > > > > >
    > > > >
    > > > --------------------------------------------------------------------------

    > > ------
    > > > > > Dim myExcelApplication
    > > > > >
    > > > > > set myExcelApplication = GetObject("Excel.Application")
    > > > > >
    > > > > > myExcelApplication.ignoreremoterequests = false
    > > > > >
    > > > > > myExcelApplication.quit
    > > > > > set myExcelApplication = nothing
    > > > >
    > > > --------------------------------------------------------------------------

    > > ------
    > > > > >
    > > > > > Have a go with that...
    > > > > >
    > > > > > If this helps then please mark the reply as helpful
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > > --
    > > > > > www.alignment-systems.com
    > > > > >
    > > > > >
    > > > > > "Duncan" wrote:
    > > > > >
    > > > > > > Setting: application.ignoreremoterequests = false
    > > > > > >
    > > > > > > VBScript: yes, because if i do it simply via a macro then users

    > > wouldnt
    > > > > > > be able to perform this by clicking on a shortcut, cos it wouldnt

    > > load
    > > > > > > the shortcut up with the setting set to true so catch 22 situation!
    > > > > > >
    > > > > > > Q: I didnt know vbscript was different to vba, just thought it was a
    > > > > > > differant version of the same thing because the commands appeared
    > > > > > > similar to me....shows my ignorance really doesnt it!
    > > > > > >
    > > > > > > Any help would be much appreciated.
    > > > > > >
    > > > > > > Duncan
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > > >
    > > > > > > John.Greenan wrote:
    > > > > > >
    > > > > > > > A few questions:
    > > > > > > > What setting do you want to change in Excel?
    > > > > > > > Do you want to create a VBScript? [Note - vbscript is nothing to

    > > do with
    > > > > > > > Excel and the vba language that Excel uses]
    > > > > > > >
    > > > > > > > Post back with some answers and I'll try to help
    > > > > > > >
    > > > > > > > --
    > > > > > > > www.alignment-systems.com
    > > > > > > >
    > > > > > > >
    > > > > > > > "Duncan" wrote:
    > > > > > > >
    > > > > > > > > Hello All,
    > > > > > > > >
    > > > > > > > > I need to create a VBS that will change the setting in excel

    > > (ignore
    > > > > > > > > other applications) to false, but I dont really know how to do

    > > this.
    > > > > > > > >
    > > > > > > > > I have played around with a .inf file someone posted on here but

    > > cannot
    > > > > > > > > get that to work either....it says installation failed..(ill put

    > > it
    > > > > > > > > below, in case it can be changed to make it work but I dont know

    > > how to
    > > > > > > > > do that either!)
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > ' [Version]
    > > > > > > > > Signature=$CHICAGO$
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > ' [DefaultInstall]
    > > > > > > > > BitReg=Bit.Settings
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > ' [Bit.Settings]
    > > > > > > > >

    > > HKCU,Software\Microsoft\Office\10.0\Excel\Options,Options,0x00000001,0x40,0
    > > > > > > > >
    > > > > > > > >
    > > > > > > > > (the above is exactly as I have it, i put the commas in because

    > > thats
    > > > > > > > > what I thought was going wrong, but apparantly not.
    > > > > > > > >
    > > > > > > > > Any help at all would be much appreciated.
    > > > > > > > >
    > > > > > > > > Duncan
    > > > > > > > >
    > > > > > > > >
    > > > > > >
    > > > > > >
    > > >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1