Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 13th, 2009, 06:44 AM
mattaseymour mattaseymour is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Location: In your head....
Posts: 556 mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)  Folding Points: 336 Folding Title: Novice Folder
Time spent in forums: 4 Days 12 h 37 m
Reputation Power: 992
Send a message via MSN to mattaseymour Send a message via Google Talk to mattaseymour
Embedding VB Macro into Excel

We are running a script which generates an excel document from data stored in a database. What we would like to do is insert a macro into the excel document we are creating so when the user opens the document the macro will be able to be used.

Does any one know if this is possible? If so does any one have a resource which could help me do this.

Thanks.
__________________
--------===============--------
I host my website with: EUKHOST
Blogging and SEO Tips
FOLLOW ME ON TWITTER @matthew_seymour

Reply With Quote
  #2  
Old October 13th, 2009, 11:07 AM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: OAKLAND CA | Adam's Point (Fairyland)
Posts: 14,938 medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 2 Weeks 2 Days 26 m 38 sec
Reputation Power: 8490
Facebook
Post

Just put this in a module

Code:
Sub Auto_Open()
   '  Name of the your macro sub to run
   '  e.g.
   MyMacro
End Sub

Sub MyMacro()
   MsgBox "Hello, World"
End Sub


Of course once you put a macro in Excel you'll get the security warnings so you'll have to assure your end users it's ok.
__________________
medialint.com

“Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss

Reply With Quote
  #3  
Old October 13th, 2009, 11:58 AM
mattaseymour mattaseymour is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Location: In your head....
Posts: 556 mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)  Folding Points: 336 Folding Title: Novice Folder
Time spent in forums: 4 Days 12 h 37 m
Reputation Power: 992
Send a message via MSN to mattaseymour Send a message via Google Talk to mattaseymour
Sorry I did not explain myself well enough.

Basically, I am generating an excel document by getting data from the database. Then modifying the header data of a html page to allow the user to download the document.

When this document is downloaded there is no macros included. What I would like to be able to do is insert a macro into this dynamically generated excel document.

Reply With Quote
  #4  
Old October 13th, 2009, 12:04 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: OAKLAND CA | Adam's Point (Fairyland)
Posts: 14,938 medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 2 Weeks 2 Days 26 m 38 sec
Reputation Power: 8490
Facebook
So your server is generating an Excel document or an HTML document? If you are downloading HTML into Excel you're SOL.

Reply With Quote
  #5  
Old October 13th, 2009, 12:37 PM
mattaseymour mattaseymour is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Location: In your head....
Posts: 556 mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)  Folding Points: 336 Folding Title: Novice Folder
Time spent in forums: 4 Days 12 h 37 m
Reputation Power: 992
Send a message via MSN to mattaseymour Send a message via Google Talk to mattaseymour
Quote:
Originally Posted by medialint
So your server is generating an Excel document or an HTML document? If you are downloading HTML into Excel you're SOL.


Yes my server is generating the document.


Define Sol?

Reply With Quote
  #6  
Old October 13th, 2009, 01:22 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Apr 2004
Location: OAKLAND CA | Adam's Point (Fairyland)
Posts: 14,938 medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)medialint User rank is General 112nd Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 6 Months 2 Weeks 2 Days 26 m 38 sec
Reputation Power: 8490
Facebook
Sh!t Out Of Luck

Your server is generating a HTML or an Excel document? If Excel then you can possibly embed a macro into the file depending on how you're going about generating the document.

Reply With Quote
  #7  
Old October 14th, 2009, 03:08 AM
mattaseymour mattaseymour is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Location: In your head....
Posts: 556 mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)mattaseymour User rank is General (90000 - 100000 Reputation Level)  Folding Points: 336 Folding Title: Novice Folder
Time spent in forums: 4 Days 12 h 37 m
Reputation Power: 992
Send a message via MSN to mattaseymour Send a message via Google Talk to mattaseymour
Quote:
Originally Posted by medialint
Sh!t Out Of Luck

Your server is generating a HTML or an Excel document? If Excel then you can possibly embed a macro into the file depending on how you're going about generating the document.


Hmmm, think I am going to have to check this as I am using some pre-developed code. Thanks for your help on the thread.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Embedding VB Macro into Excel

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap