Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Running a Macro from hidden Workbook

I am running a app (SPSS) that does some Excel manipulations.

I have an Excel WOrkbook called macros.xls that opens up
hidden whenever Excel is started.

Running objExcel.App.Run "Macro" does not work while macros.xls
is hidden. If I unhide macros.xls then the line does work.

Is there a way to Run this macro without unhiding macros.xls
every time?

Lance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Running a Macro from hidden Workbook

Visibility isn't a problem in xl2002.

This worked for me (started in MSWord):

Option Explicit
Sub testme01()

Dim objExcel As Object
Dim objWkbk As Object

Set objExcel = CreateObject("excel.application")
objExcel.Visible = True

Set objWkbk = objExcel.workbooks.Open("C:\my documents\excel\macros.xls")
objExcel.Run objWkbk.Name & "!macro"
'this worked, too:
'objExcel.Application.Run objWkbk.Name & "!macro"

End Sub

And my macros.xls was a hidden workbook.


Lance Hoffmeyer wrote:

I am running a app (SPSS) that does some Excel manipulations.

I have an Excel WOrkbook called macros.xls that opens up
hidden whenever Excel is started.

Running objExcel.App.Run "Macro" does not work while macros.xls
is hidden. If I unhide macros.xls then the line does work.

Is there a way to Run this macro without unhiding macros.xls
every time?

Lance


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro running against hidden worksheet George Excel Discussion (Misc queries) 1 July 23rd 07 09:42 PM
VBA Macro cannot see hidden workbook andjbird via OfficeKB.com Excel Discussion (Misc queries) 0 July 26th 06 03:38 PM
Help:Running a macro in one excel workbook from another workbook R Kapoor Setting up and Configuration of Excel 3 January 13th 06 05:11 AM
Running a macro in another workbook Blue Excel Programming 1 July 10th 04 04:04 PM
Running a macro in another workbook Blue Excel Programming 4 July 9th 04 07:38 PM


All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"