Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default problem with excel refreshing Via macro

hello all

i have a master excel file that i wrote a macro that will open anther excel file
the second file has pivot tables and other tables link Via odbc to SQL server
the problem is that after i write "activeworkbook.refreshall
and then "activeworkbook.save " i recieved a msgbox from excel as following
"This action will cancel a pendingrefresh data command do u what to continue? yes /no.

i know how to disable the msgbox but it does not refresg the info if i press yes or no
the strange thing is ehn i run a local macro on the file it works

I think the problem happen when i do "activeworkbook.save

i looked up the excel help
"When I click the Refresh button, a message tells me that my macro changes will be lost
This message appears when you have made changes to a macro in the Visual Basic Editor and have also changed the copy of your workbook in the Microsoft Script Editor

To save the changes to your macro, do the following:
Click No
Switch to the Visual Basic Editor window
Export any modules you have changed.(how do i do it
In the workbook, click Refresh on the Refresh toolbar
Click Yes
Import the modules to restore the changes to your macro. .(how do i do it

please answer me ASAP

Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default problem with excel refreshing Via macro

Sounds like your refresh is running asynchronously (background refresh)
Try playing the the "background refresh" option for your data sources.

If you lookup "RefreshAll" in help, you'll see what I'm referring to.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"pando" wrote in message
...
hello all,

i have a master excel file that i wrote a macro that will open anther

excel file.
the second file has pivot tables and other tables link Via odbc to SQL

server.
the problem is that after i write "activeworkbook.refreshall"
and then "activeworkbook.save " i recieved a msgbox from excel as

following :
"This action will cancel a pendingrefresh data command do u what to

continue? yes /no."

i know how to disable the msgbox but it does not refresg the info if i

press yes or no.
the strange thing is ehn i run a local macro on the file it works.

I think the problem happen when i do "activeworkbook.save "

i looked up the excel help :
"When I click the Refresh button, a message tells me that my macro changes

will be lost.
This message appears when you have made changes to a macro in the Visual

Basic Editor and have also changed the copy of your workbook in the
Microsoft Script Editor.

To save the changes to your macro, do the following:
Click No.
Switch to the Visual Basic Editor window.
Export any modules you have changed.(how do i do it)
In the workbook, click Refresh on the Refresh toolbar.
Click Yes.
Import the modules to restore the changes to your macro. .(how do i do it)

please answer me ASAP,

Thanks in advance,





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default problem with excel refreshing Via macro

Actually, refreshall makes no mention of the backgroundquery setting. It is
an argument to the refresh method for both the querytable and pivottable
objects if you wanted to loop through your tables to refresh them, or it is
a parameter for the querytable and pivottable objects which you can set so
you can continue to use refreshall. As Rob suggested, probably currently
set to false.


--
Regards,
Tom Ogilvy


"Rob van Gelder" wrote in message
...
Sounds like your refresh is running asynchronously (background refresh)
Try playing the the "background refresh" option for your data sources.

If you lookup "RefreshAll" in help, you'll see what I'm referring to.

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"pando" wrote in message
...
hello all,

i have a master excel file that i wrote a macro that will open anther

excel file.
the second file has pivot tables and other tables link Via odbc to SQL

server.
the problem is that after i write "activeworkbook.refreshall"
and then "activeworkbook.save " i recieved a msgbox from excel as

following :
"This action will cancel a pendingrefresh data command do u what to

continue? yes /no."

i know how to disable the msgbox but it does not refresg the info if i

press yes or no.
the strange thing is ehn i run a local macro on the file it works.

I think the problem happen when i do "activeworkbook.save "

i looked up the excel help :
"When I click the Refresh button, a message tells me that my macro

changes
will be lost.
This message appears when you have made changes to a macro in the Visual

Basic Editor and have also changed the copy of your workbook in the
Microsoft Script Editor.

To save the changes to your macro, do the following:
Click No.
Switch to the Visual Basic Editor window.
Export any modules you have changed.(how do i do it)
In the workbook, click Refresh on the Refresh toolbar.
Click Yes.
Import the modules to restore the changes to your macro. .(how do i do

it)

please answer me ASAP,

Thanks in advance,







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import External Text Data and Refreshing Problem Douglas Excel Worksheet Functions 0 August 20th 07 09:30 AM
Problem refreshing published web pages to Sharepoint with Excel 20 DrkTnn Excel Discussion (Misc queries) 0 June 28th 07 02:42 PM
refreshing pivot tables with a macro Lou Sanderson Excel Discussion (Misc queries) 10 October 17th 06 07:57 PM
problem refreshing data query on yahoos jcoudrie0734 Excel Discussion (Misc queries) 0 October 4th 05 12:14 AM
VC Problem refreshing pivot table Vickster3659 Excel Discussion (Misc queries) 6 June 1st 05 03:15 PM


All times are GMT +1. The time now is 04:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"