LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Application-defined or object-defined error on copy

I have an Excel 97-2003 add-in that includes a toolbar that includes a copy
of Excel's Design Mode toolbar button (View | Toolbars | Control Toolbox).
My users click this button to put the worksheet into design mode so they can
change the layout of controls (command buttons, etc) programatically placed
onto the worksheet.

Another button on this toolbar allows them to save their updated worksheet
design. If they click this button while they are still in design mode, then
when my VBA code gets around to performing:

thisWorkbook.ActiveSheet.Copy after:=thatWorkbook.Worksheets(1)

it gets "Application-defined or object-defined error" error message.

The way I've implemented the design mode, my code never sees the user's
button click that puts them into (or out of) design mode. So I currently
have no way to "remember" that I'm currently in design mode and get myself
out before trying to save the redesigned worksheet (of course that assumes I
know how to programatically get our of design mode and I don't).

So a few questions:

- Is there a way for my code to detect that the workbook (or is it the
project?) is still in design mode? If so how?

- If there is, is there some way for my code to get out of design mode?

- Is there some other way of having a toolbar button toggle in and out of
design mode where my code is in the execution loop rather than just copying
Excel's Design Mode toolbar button onto my toolbar?

TIA,

josh


 
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
Run-time error '50290': Application-defined or object-defined erro Macro button Excel Discussion (Misc queries) 1 March 12th 09 10:59 AM
Application-defined or object-defined error - missing the basics [email protected] Excel Programming 1 December 28th 04 10:23 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM
Runtime Error 1004 -- Application Defined or Object Defined Error John[_51_] Excel Programming 3 September 4th 03 04:28 PM


All times are GMT +1. The time now is 06:18 AM.

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"