Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #110867

Re: executing VBA macro in Excel from OLE

From Adrian Caspersz <email@here.invalid>
Newsgroups microsoft.public.excel.programming
Subject Re: executing VBA macro in Excel from OLE
Date 2019-03-26 23:58 +0000
Organization Keep Usenet Text Newsgroups Alive!!
Message-ID <gfvskiFr119U1@mid.individual.net> (permalink)
References <q7dok0$673$2@dont-email.me> <q7ds1b$vp1$1@dont-email.me> <gfveotFo30nU1@mid.individual.net> <q7e9mn$1vl$1@dont-email.me>

Show all headers | View raw


On 26/03/2019 22:39, Lynn McGuire wrote:
> On 3/26/2019 3:01 PM, Adrian Caspersz wrote:
> 
> Cool, I got it to work with the following and my macro was run:
> 
> PS C:\Users\lmc> $E = New-Object -ComObject Excel.Application
> PS C:\Users\lmc> $workbook = $E.Workbooks.Open("C:\dii\spreadsheet2.xlsm")
> PS C:\Users\lmc> $E.Run("testmacro")
> PS C:\Users\lmc> $workbook.save()
> PS C:\Users\lmc> $workbook.close()
> 
> But I could not get Excel to quit:
> 
> PS C:\Users\lmc> $workbook.quit()

$E.quit() should work.

-- 
Adrian C

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

executing VBA macro in Excel from OLE Lynn McGuire <lynnmcguire5@gmail.com> - 2019-03-26 12:47 -0500
  Re: executing VBA macro in Excel from OLE Lynn McGuire <lynnmcguire5@gmail.com> - 2019-03-26 13:46 -0500
    Re: executing VBA macro in Excel from OLE Adrian Caspersz <email@here.invalid> - 2019-03-26 20:01 +0000
      Re: executing VBA macro in Excel from OLE Lynn McGuire <lynnmcguire5@gmail.com> - 2019-03-26 16:54 -0500
      Re: executing VBA macro in Excel from OLE Lynn McGuire <lynnmcguire5@gmail.com> - 2019-03-26 17:39 -0500
        Re: executing VBA macro in Excel from OLE Adrian Caspersz <email@here.invalid> - 2019-03-26 23:58 +0000
        Re: executing VBA macro in Excel from OLE GS <gs@v.invalid> - 2019-03-27 11:47 -0400
    Re: executing VBA macro in Excel from OLE Lynn McGuire <lynnmcguire5@gmail.com> - 2019-03-27 16:30 -0500
      Re: executing VBA macro in Excel from OLE Adrian Caspersz <email@here.invalid> - 2019-03-28 00:28 +0000
  Re: executing VBA macro in Excel from OLE Lynn McGuire <lynnmcguire5@gmail.com> - 2019-03-26 14:47 -0500

csiph-web