|
-
Dec 27th, 2004, 04:25 PM
#1
Re: Excel.. Exit Edit Mode
What if, before you make the copy/paste, you change the selection to
another row and then back to the sorce/target row? That should take it out
of edit mode.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 28th, 2004, 02:09 AM
#2
Thread Starter
Addicted Member
Re: Excel.. Exit Edit Mode
xlSheetInput.Cells(1, 1).Select
ERROR:
Select Method or Range Class Failed.
ahhhh!!!!... why doesn't that work?!
-SpeedyDog
-
Dec 30th, 2004, 03:16 PM
#3
Re: Excel.. Exit Edit Mode
Ok, here is the perfect solution. Disable editing on just your application object.
It will not effect any other instances before or after, that the user may or
may not have opened already or will open.
VB Code:
Option Explicit
Private moApp As Excel.Application
Private moWB As Excel.Workbook
Private Sub Command1_Click()
moWB.Sheets("Sheet1").Cells(1, 1).Value = "Test"
moWB.Sheets("Sheet1").Cells(1, 1).Copy
moWB.Sheets("Sheet2").Activate
moWB.Sheets("Sheet1").Paste Destination:=moWB.Sheets("Sheet2").Cells(1, 1)
End Sub
Private Sub Form_Load()
Set moApp = New Excel.Application
moApp.Visible = True
Set moWB = moApp.Workbooks.Add
If moApp.EditDirectlyInCell = True Then
moApp.EditDirectlyInCell = False
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If moApp.EditDirectlyInCell = False Then
moApp.EditDirectlyInCell = True
End If
moWB.Close False
moApp.Quit
Set moWB = Nothing
Set moApp = Nothing
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 30th, 2004, 09:36 PM
#4
Thread Starter
Addicted Member
Re: Excel.. Exit Edit Mode
This doesn't work?....
goto sheet 2, and start typing in say 3,5 for example just type in randomness, don't exit out of edit mode... and then push Command1... it deosn't write text, or copy it until AFTER you exit out of edit mode :-/
-SpeedyDog
-
Dec 30th, 2004, 09:51 PM
#5
Re: Excel.. Exit Edit Mode
If you noticed that I have code in the Form_Load event to disable the edit
capability. Then if the user tries to edit anything in Excel, it wont go into
editmode. 
VB Code:
Private Sub Form_Load()
Set moApp = New Excel.Application
moApp.Visible = True
Set moWB = moApp.Workbooks.Add
If moApp.EditDirectlyInCell = True Then
moApp.EditDirectlyInCell = False 'TURNS EDIT MODE OFF
End If
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 30th, 2004, 10:37 PM
#6
Thread Starter
Addicted Member
Re: Excel.. Exit Edit Mode
that doens't turn off Edit mode for my version of Excel? EXCEL XP version 10.x .... I even ended up taking out that if statement and just making it false.. and I can still edit :-/ But people need to beable to edit...
I need to EXIT the edit mode, when they click the update...
-SpeedyDog...
P.S.
Project DueDate for client is Monday :-/ (edit: wow, acutally not till the 1-10-2005)
I mean, things work fine, just it hangs if they don't exit out of edit mode when they go to update, and since they are paying $3,000/month for this program I figured I should get that fixed :-P
Last edited by SpeedyDog; Dec 31st, 2004 at 04:38 PM.
-
Dec 30th, 2004, 10:47 PM
#7
Re: Excel.. Exit Edit Mode
So if I get it working for you do I get $3k???
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|