Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Kind of embedded macro


I have detected a few functions in VBA that doesn't work properly whe
upgrading from 2000 to XP. So, I have this template with quite a fe
macros in it, which I have corrected to work properly in XP.

Now, I have used this template for quite some years and therefore hav
older excelsheets, that do not work now when I have upgraded to XP.

So instead of manually correct each file, I am thinking of writing som
kind of macro that automatically detects and changes the lines tha
needs to be corrected.

My question is therefo Is it possible to write a "macro tha
manipulates another macro"?

Or do I need to write that in another programming language?


Cheer

--
Svedbo Activ
-----------------------------------------------------------------------
Svedbo Active's Profile: http://www.excelforum.com/member.php...fo&userid=2636
View this thread: http://www.excelforum.com/showthread.php?threadid=39638

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Kind of embedded macro

Hi Svedbo Active,

I have detected a few functions in VBA that doesn't work properly when
upgrading from 2000 to XP.


I am aware of post-XL2K features which are not available in earlier
versions; I am not aware of the reverse. What are these functions?

My question is therefo Is it possible to write a "macro that
manipulates another macro"?

Or do I need to write that in another programming language?


See Chip Pearson's 'Programming to the VBE ' page at:

http://www.cpearson.com/excel/vbe.htm




Regards,
Norman



"Svedbo Active"
wrote in message
news:Svedbo.Active.1twiag_1124269536.6661@excelfor um-nospam.com...

I have detected a few functions in VBA that doesn't work properly when
upgrading from 2000 to XP. So, I have this template with quite a few
macros in it, which I have corrected to work properly in XP.

Now, I have used this template for quite some years and therefore have
older excelsheets, that do not work now when I have upgraded to XP.

So instead of manually correct each file, I am thinking of writing some
kind of macro that automatically detects and changes the lines that
needs to be corrected.

My question is therefo Is it possible to write a "macro that
manipulates another macro"?

Or do I need to write that in another programming language?


Cheers


--
Svedbo Active
------------------------------------------------------------------------
Svedbo Active's Profile:
http://www.excelforum.com/member.php...o&userid=26366
View this thread: http://www.excelforum.com/showthread...hreadid=396385



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Kind of embedded macro


Since my template's macro is corrected, and all I want to do is to ope
my earlier .xls-files and correct these macros, it might be easier t
just replace the VBA-projects that do not work, with the one tha
does?

But...how do i do this?

Basically, I have a lot of users that have used the template. So
would like to send them an email that says "In order for your exce
files created in excel 2000 to work in excel 2003, you need to run th
file correction.xls and follow the instructions"

Then, the correction.xls will contain a macro that prompts them t
browse to their file, kind of:

Sub UserChooseFile()
Dim f As Variant
Dim i As Integer
f = Application.GetOpenFilename()
If f < False Then
MsgBox "Open " & f
Workbooks.Open (f)
ThisWorkbook.Unprotect
Else
MsgBox "the Open was cancelled"
End If
'***** add process code here ******
End Sub

...found otherwhere on this forum.


When they then have opened their workbook, I need to replace the VB
project "connected" to their workbook, with the one that I hav
corrected.
(they are identical with the only exception that I have deleted
number of lines of code that do not work).

So, is it possible to replace one VBA project with another?


Would be grateful for any help

--
Svedbo Activ
-----------------------------------------------------------------------
Svedbo Active's Profile: http://www.excelforum.com/member.php...fo&userid=2636
View this thread: http://www.excelforum.com/showthread.php?threadid=39638

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Kind of embedded macro


Thanx Norman, I will have a look at Chip Person's page. Though, I'm no
that good at VB so I'm not sure I'll understand. Worth a try though.

Regarding the functions that don't work properly, you made me sweat
bit, 'cause it could well be that I'm wrong, but anyway:

If Worksheets("indata").Protect = True Then
Worksheets("indata").Unprotect
Else
End If

This code works in excel 2000, but not in excel 2003, as far as I coul
see.
It never detected that "indata" was protected and therefore didn'
unprotect it. This lead to the rest of the macro not working, wit
error messages like "Unable to set hidden property...etc"

What I did was then to simply just keep

Worksheets("indata").Unprotect

regardless of whether it already was unprotected or not.

But as I said, I might be wrong, but it sure as h*ll did not work unti
i changed it.
I also tried to add a watch to worksheets("indata"), (not sure abou
the result. Used to C++ but not to VBA)
and step through the code. The sheet was indeed protected, bu
ProtectionMode was false. ProtectContents was true though.

I dont know, but could this be the clue to the problem maybe?

Regard

--
Svedbo Activ
-----------------------------------------------------------------------
Svedbo Active's Profile: http://www.excelforum.com/member.php...fo&userid=2636
View this thread: http://www.excelforum.com/showthread.php?threadid=39638

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Kind of embedded macro


and as I expected, I didn't udnerstand Chris's site enough to solve m
problem.

So, if there is anyone out there that knows of code that copies th
total VBA project (objects, forms, modules) and replaces anothe
project with that one, please let me know

--
Svedbo Activ
-----------------------------------------------------------------------
Svedbo Active's Profile: http://www.excelforum.com/member.php...fo&userid=2636
View this thread: http://www.excelforum.com/showthread.php?threadid=39638

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
Using a Macro in Excel to send an embedded sheet via Outlook Bill Leffler Excel Discussion (Misc queries) 3 July 23rd 08 10:47 PM
kind of chart? Kim Charts and Charting in Excel 1 June 27th 07 02:51 AM
I have a kind of complex macro or vb script I want to program but do not know? bjwoodruff Excel Programming 4 June 14th 05 10:35 PM
Embedded button print macro grantfeek Excel Programming 1 February 28th 05 10:21 PM
Kind of Vlookup Andre[_3_] Excel Programming 1 May 24th 04 05:23 PM


All times are GMT +1. The time now is 09:45 AM.

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

About Us

"It's about Microsoft Excel"