Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Getting "Object Required" Error Message - Need Help !!!

I have an Excel workbook (Automate_WTI.xls) with three sheets - Sheet1,
Sheet2 and Sheet3. I wrote some VBA code under the Auto_Open routine in
the module file so that it will execute automatically when the XLS is
loaded. The code in this routine performs three basic things:

1. Loads an Excel Add-In.
2. Makes calls to this add-in to retrieve data from an external database
over the WAN and populates the Sheets.
3. Sends output to a network printer

Then I wrote a VB6 frontend to call the above Workbook. My goal is to have a
VB wrapper, which loops through a network folder; processes each workbook it finds.
The end result is to setup one single VB EXE in Windows 2000 Task Scheduler
to execute at certain time. Here's the test VB code I have:

Private Sub Command1_Click()


Dim xl As Excel.Application
Dim wkb As Excel.Workbook
Dim wks As Excel.Worksheet
Dim apppath As String

apppath = App.Path & "\" & "Automate_WTI.xls"

Set xl = New Excel.Application
xl.Visible = True

Set wkb = xl.Workbooks.Open(FileName:=apppath)

wkb.RunAutoMacros xlAutoOpen

'wkb.Save
'wkb.Close
'xl.Quit
'Set wks = Nothing
'Set wkb = Nothing
'Set xl = Nothing

End Sub


The problem I am having is when I invoke the VB EXE, I can see it loads my
workbook but puts me in debug mode with an error on this line in Auto_Open
routine and the error message is "Object Required"

Application.Run "Login", strMyLogin, strMyPasswd <-- stops here in debug mode

The above line makes a call to the Add-In to login to the external database.

Can someone provide some help and explain to me what I need to fix this? My
Excel/VBA skill is limited but good in VB.

Thank you in advance!!!


Sydney Luu

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Getting "Object Required" Error Message - Need Help !!!

Sydney,

Try adding the add-in workbook name to the Application.Run call...
( note the exclamation point that separates the workbook name from the sub routine )

Application.Run "MyAddInName.xla!Login, strMyLogin, strMyPasswd"

Regards,
Jim Cone
San Francisco, CA

wrote in message
om...

-snip-

The problem I am having is when I invoke the VB EXE, I can see it loads my
workbook but puts me in debug mode with an error on this line in Auto_Open
routine and the error message is "Object Required"
Application.Run "Login", strMyLogin, strMyPasswd <-- stops here in debug mode
The above line makes a call to the Add-In to login to the external database.
Can someone provide some help and explain to me what I need to fix this? My
Excel/VBA skill is limited but good in VB.
Thank you in advance!!!
Sydney Luu

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Getting "Object Required" Error Message - Need Help !!!

Thanks for responding. This did not help fix the problem - still get
"Object Required" on that line.


"Jim Cone" wrote in message ...
Sydney,

Try adding the add-in workbook name to the Application.Run call...
( note the exclamation point that separates the workbook name from the sub routine )

Application.Run "MyAddInName.xla!Login, strMyLogin, strMyPasswd"

Regards,
Jim Cone
San Francisco, CA

wrote in message
om...

-snip-

The problem I am having is when I invoke the VB EXE, I can see it loads my
workbook but puts me in debug mode with an error on this line in Auto_Open
routine and the error message is "Object Required"
Application.Run "Login", strMyLogin, strMyPasswd <-- stops here in debug mode
The above line makes a call to the Add-In to login to the external database.
Can someone provide some help and explain to me what I need to fix this? My
Excel/VBA skill is limited but good in VB.
Thank you in advance!!!
Sydney Luu

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Getting "Object Required" Error Message - Need Help !!!

Instead of 'Application', use the application object you created
with the Set New statement. E.g.,

xl.Run ....


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




wrote in message
om...
Thanks for responding. This did not help fix the problem -
still get
"Object Required" on that line.


"Jim Cone" wrote in message
...
Sydney,

Try adding the add-in workbook name to the Application.Run
call...
( note the exclamation point that separates the workbook name
from the sub routine )

Application.Run "MyAddInName.xla!Login, strMyLogin,
strMyPasswd"

Regards,
Jim Cone
San Francisco, CA

wrote in message
om...

-snip-

The problem I am having is when I invoke the VB EXE, I can
see it loads my
workbook but puts me in debug mode with an error on this
line in Auto_Open
routine and the error message is "Object Required"
Application.Run "Login", strMyLogin, strMyPasswd <-- stops
here in debug mode
The above line makes a call to the Add-In to login to the
external database.
Can someone provide some help and explain to me what I need
to fix this? My
Excel/VBA skill is limited but good in VB.
Thank you in advance!!!
Sydney Luu



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
cannot insert rows -error message "cannot shift object off sheet" robwan Excel Discussion (Misc queries) 1 November 10th 07 03:01 PM
Error message: "cannot shift object off sheet" Peter Vickers Excel Worksheet Functions 4 December 8th 06 04:52 PM
"Microsoft Visual Basic runtime error '424' object required". SharonG. Excel Worksheet Functions 0 July 5th 06 01:36 AM
I get an error message that says "Cannot shift object off a page" JZygmun Excel Discussion (Misc queries) 1 March 7th 06 02:18 AM
error while compiling "OBJECT REQUIRED" nuti Excel Discussion (Misc queries) 1 January 12th 06 03:14 PM


All times are GMT +1. The time now is 08:55 AM.

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

About Us

"It's about Microsoft Excel"