|
-
Mar 12th, 2003, 03:07 AM
#1
Thread Starter
Lively Member
Excel - editing
What does
Code:
MyXL.Workbook(1).Activate
Do??
Whhy wont this damn thing work!! Damn it!!!
-
Mar 12th, 2003, 04:11 AM
#2
If you have 2 excel files open (workbooks), this code will mimmick the user clicking onto one of the excel workbook windows to select it so as they can start entering values into it's sheets.
-
Mar 12th, 2003, 04:59 AM
#3
Thread Starter
Lively Member
so in other words....it doesnt solve my problem...dang!!!
As per another post...my problem is this...
Code:
MyXL.application.visible = true
MyXL.Windows(1).visible = True
The above code (plus other bits and pieces i have) opens excel and opens my specified file within it. What i want is for the user to edit the spreadsheet and then save it, however, you cannot edit the spreadsheet at all....you cant even click on another cell...its locked up!!!! You can however, use the excel file menu to close etc etc
Im wondering if the sheet i open isnt active???
matt
Whhy wont this damn thing work!! Damn it!!!
-
Mar 12th, 2003, 05:12 AM
#4
I think it's to do with the file itself - outside of the code/vb, can you open up the same Excel file in Excel itself & goto the Tools menu - there's a protection submenu 1/2 way down which should have a "Protect sheet" option there - if you can't see this, but see an "Un-Protect sheet" option, this means someone has added a password to restrict anyone from being able to edit & save the workbook on the actual file itself & I would contact the person who created the file to get them to remove this locking/protection ....
-
Mar 12th, 2003, 05:19 AM
#5
Ah, yeah - another thought, there is another way to set protection on an Excel file - if you open the same file up again from within Excel, then goto the Save as menu, you'll see an "advanced" button on the prompting save dialog box which appears, under this button/menu there's a "save options" or "general options" setting/submenu you can click where you can also set this restriction, again, remove this setting & re-save the file ...
-
Mar 12th, 2003, 07:39 AM
#6
Thread Starter
Lively Member
Hi
Its not a protection issue...the excel file was created by me 2 mins before i did the file so theres no protection.
Also...when a file does have protection, you can normally view it as read only anyway and still edit it but have to save it under a different file name...
Matt
Whhy wont this damn thing work!! Damn it!!!
-
Mar 12th, 2003, 08:00 AM
#7
As per another post...my problem is this...
Okay, which one's your other post then, can you post the link for me please?
-
Mar 12th, 2003, 08:03 AM
#8
Fanatic Member
Code:
Dim xclObject As New Excel.Application
Dim xclWorkBook As Excel.Workbook
Dim xclWorkSheet As Excel.Worksheet
Set xclWorkBook = xclObject.Workbooks.Open("c:\temp.xls")
Set xclWorkSheet = xclWorkBook.ActiveSheet
xclObject.Application.Visible = True
xclWorkSheet.Visible = xlSheetVisible
i did this and it was visible and i could edit it
-
Mar 12th, 2003, 08:12 AM
#9
To do what you're trying, only this is needed really, this will open up an excel file so the users can edit it - if this can't be edited, then it's definitley down to the file itself - maybe the read only flag is ticked on the file right click properties? Or maybe there is a piece of code running on the workbook_activate event which is disabling the editing?
Code:
Private Sub Form_Load()
Dim xclObject As Excel.Application
Set xclObject = New Excel.Application
With xclObject
.Workbooks.Open ("c:\temp.xls")
.Workbooks(1).Worksheets(1).Select
.Visible = True
End With
End Sub
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
|