473,407 Members | 2,314 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,407 software developers and data experts.

If a workbook is closed directly from excel vba and then opened from code within VBA.

What I want to know is that while one excel application is closed by VBA code from module, another excel application has to be opened.
That means, I have written code to open new excel sheet in the Workbook_BeforeClose.

I have written a code like workbooks.open (Path\filename)

If a workbook is closed directly from excel vba and then opened from code within VBA. It is not working.

It is working fine while we close excel application manually. But it is not working while try to do through VBAcode.

Could you Please help me.

I am using Excel 2000.

Musai.
May 10 '08 #1
2 2313
Dököll
2,364 Expert 2GB
What I want to know is that while one excel application is closed by VBA code from module, another excel application has to be opened.
That means, I have written code to open new excel sheet in the Workbook_BeforeClose.

I have written a code like workbooks.open (Path\filename)

If a workbook is closed directly from excel vba and then opened from code within VBA. It is not working.

It is working fine while we close excel application manually. But it is not working while try to do through VBAcode.

Could you Please help me.

I am using Excel 2000.

Musai.
Greetings, Musai!

I read your post and felt it would be advantageous if code were also posted, you can post at least part of it, or perhaps all, just someone may see what's a miss, all in all it would be a effective way to help you.

You may also find something already posted if you fetch deeper into the pages through search terms up above.

Good luck with the project!

Dököll
May 11 '08 #2
Thanks for updates.

In .bas Module, I have written the application after executing some task.

Public sub close_file
ThisWorkbook.Close savechanges:=False
End sub

Ex:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim strfile as Strfile
Strfile=”c:\Test.xls”
Workbooks.Open strfile
End Sub

While try to close the application through VBA code and open another excel application it is not working.

That means I am trying to close through “close_file” the procedure.

It is working fine while try to close manually.

Could anybody tell me about this issue.

Regards
musai
May 12 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Marc | last post by:
Hi all, I have a problem with managing the interchange between COM/Excel and Python if the user closes the workbook externally. Everything works fine as long as the user only uses the exit...
2
by: Belinda | last post by:
Hello All I want to place a Excel workbook on the web server and create a URL link to it and when the user clicks on it to the URL/vbscript behind it must launch Excel on the client and open the...
1
by: Lize | last post by:
Hi, I'm writing an ASP application to open an excel workbook, then run a macro stored in the excel file, which produces outputs that will be displayed back onto my ASP application. Now the...
2
by: BerkshireGuy | last post by:
I am writing an Module in Access 2000 that needs to reference an opened Excel Workbook. Lets say the workbook is called Rankings. How would I reference that workbook from within Access? Thanks
1
by: Randall Arnold | last post by:
I have a VB.net assembly that manipulates excel data. At the end of data processing, the user has the option to view the spreadsheet, which is at that time open and not visible. So at this point...
10
by: John Brock | last post by:
My VB.NET program pops up an Excel workbook for the user. If I initially create the workbook using: Workbooks.Add(Microsoft.Office.Interop.Excel.XlWBATemplate.xlWBATWorksheet) I end up with a...
0
by: f.oualid | last post by:
Hi, Would anyone know how I could open an already opened excel workbook. I have Windows Form with a button, and when clicked it opens the spreadsheet as follows string filename =...
7
by: NeverLift | last post by:
This is probably answered elsewhere, but I've searched the Web and VBA for Excel manual, find no answers. I have a VBA-coded macro in an Excel workbook that is to open another existing workbook --...
4
by: omono84 | last post by:
I know that this should be rather simple but i seem to be missing a step to get it to work. and have been unable to find a solution on the net. The aim is that I click on the open button to find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.