Problems in saving excel file using excel macros

G

Guest

I have an Excel sheet at work with macros attached to it. I saved the
worksheet as a different file name so I could make changes. Now anytime I try
to execute any of the macros in the original worksheet, it first opens the
file that I "saved as" before it'll execute the macro. I deleted the file
that I'd "saved as" and now it won't execute a macro at all. It gives me an
error message saying it can't find a specified file. I've checked over the VB
coding of the macros to see if Excel made reference to the new file that I'd
saved, but can't find it referenced anywhere in the code
 
D

Don Lloyd

Try right-clicking each control in your workbook and re-assigning the the
macros.

regards,
Don
 
G

Guest

Hi Don,

Thanks a lot for your instant reply. I tried your suggestion but the
first time when I re-assign the macros it works. The second time when I again
run the macro it will again open the file that was saved previously. I am
unable to get rid of this.
Can you please help.
 
D

Don Lloyd

Hi,
I assume that you saved the Workbook after re-assigning.
If you did, then double-check to make sure that you haven't missed a control
somewhere. It only takes one!
regards,
Don
 
G

Guest

Hi,
I did save the workbook after re-assigning.
Well let me give you a more clear and consice description of my problem. I
have a button on the toolbar which is linked to a macro. When I click this
button the macro fires and get me some data from the DB which is formatted
and saved in the XLS file. At the very first instance after applying your
suggestion, the macro ran as per expectation and got the data from the DB and
saved the data into and XLS file. Now when I am again running this macro,
that is when I again click on this button on the toolbar then before
retriving the records from the DB it opens the previously saved file. I then
checked the macro assigned to the button on the toolbar and I find it that it
gets changed. I am unable to figure out the problem.
Can you please help?

Thanks.
Zamir
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top