473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to hide excel close button programatically

Hello all,
I have to open a readonly Excel sheet from clicking on a button on an access
form. So far no problem:
Dim ObjXL As Excel.Application
Dim ObjXLBook As Excel.Workbook
Dim ObjXLSheet As Excel.Worksheet
Set ObjXL = CreateObject("Excel.Application")
Set ObjXLBook = ObjXL.Workbooks.Open("Mypath\Myfile.xls", , True)
Set ObjXLSheet = ObjXLBook.Worksheets("Main")
ObjXL.Visible = True

Then the user puts in the data. However, I want to prevent him from giving
it the wrong name and save it in the wrong place.
So I want to hide the close button on the sheet and insert a custom button
which gives the file the right name and saves it at the right place (path).
So my questions are ... How do I hide the close button when opening the file
(if at all possible) and what is the correct code to put on the onclick
event of the custom button to give it the right name and right place ?
Any help very much appreciated.
Ronny
Nov 12 '05 #1
2 4704
You can't hide the close button. If you have control over the origination of
MyFile.xls, then you could add code to it that would prevent anyone from
closing the workbook unless they used your special button.

If you DON'T have control over the origination of MyFile, then I have two
options for you, since you seem to KNOW what to name the file and where to put
it BEFORE they even open the file:

1) Before opening it, copy it to the new name/location, and make it editable

2) After the user gets back to Access, test for the name/path (using DIR
function), and pop up an appropriate guilt message as needed.
Nov 12 '05 #2
Thank you, this sure helps
Ronny
"DCM Fan" <dc****@aol.comSPNOAM> schreef in bericht
news:20***************************@mb-m01.aol.com...
You can't hide the close button. If you have control over the origination of MyFile.xls, then you could add code to it that would prevent anyone from
closing the workbook unless they used your special button.

If you DON'T have control over the origination of MyFile, then I have two
options for you, since you seem to KNOW what to name the file and where to put it BEFORE they even open the file:

1) Before opening it, copy it to the new name/location, and make it editable
2) After the user gets back to Access, test for the name/path (using DIR
function), and pop up an appropriate guilt message as needed.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Vikram | last post by:
Hi, Given below is my task. An user can open the xls file from my website (loaded on the top frame). After filling the Excel, he can click a send button at the bottom frame. By clicking the...
2
by: Ronny Sigo | last post by:
Hello all, I have to open a readonly Excel sheet from clicking on a button on an access form. So far no problem: Dim ObjXL As Excel.Application Dim ObjXLBook As Excel.Workbook Dim ObjXLSheet As...
6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
1
by: Andre Ranieri | last post by:
I'm having trouble programatically inserting an Excel file into an Image column in our CRM package's SQL 2000 database. The function appears to work ok, but when I attempt to access the file through...
2
by: Kumar | last post by:
Hi Folks, I have a question regarding my windows c# application. This application just reads MS Excel file and puts the data in to sql server database. In that excel file ,it has one named cell...
2
by: Flo | last post by:
Hello I want to be able to show/hide an application that is running. When i am getting the handles corresponding to an MS Office application (Excel for example), it appears that i get a handle...
5
by: dje | last post by:
In the OnClick event on a radioButtonList, I run a javascript to show/hide the appropriate div along with a submit button, which displays as expected. The problem is the submit no longer works on...
1
by: garry.oxnard | last post by:
Can anyone help me to solve a problem which involves switching from Access to Excel (then back to Access) programatically please? I have an Excel template which, on open, also opens an Access...
1
by: sorcerdon | last post by:
Hello experts, I am currently opening an excel file from a VB.net application. The excel spreadsheet gets all its data from a Dataset. I need to hide a column form the results. I dont want the...
2
by: iloveprincess | last post by:
Hi, I'm developing windows application using VB.Net 2005. I would like to send 'save' message using 'SendMessage' API to the excel appication. I've already got a handle of the excel window with...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.