473,320 Members | 1,978 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,320 software developers and data experts.

Microsoft Excel VBA

risk32
98
I have, at the very least a troublesome program I'm creating. I have somewhat of a prehistoric calender setup with radio buttons for 01-31 (representing the days of the month), January - December, and a small text box for input for the year (last 2 chars only ie. 08, 09). There is also a 'Go' button on the 3rd page, which I was trying to use to shell out to PowerPoint, using the value for the label as the path.
Everything seems to work just fine, except the last steps to complete the task of taking the value of each button and changing the value of a label to reflect what day/month/year has been selected for the label plus the coding for the shell commmand.

I am at best a noob programmer, but I have the basic concepts down.

Here is what I have so far (pictures emailed upon request) :
Expand|Select|Wrap|Line Numbers
  1.  Private Sub cmdBack_Click()
  2. MultiPage1.Value = 0
  3. End Sub
  4.  
  5. Private Sub cmdNext_Click()
  6. MultiPage1.Value = 1
  7. End Sub
  8.  
  9. Private Sub cmdGenerate_Click()
  10. MultiPage1.Value = 2
  11. lblLink = "\\yofs13\374OG\36AS\Asgard_data\data\Duty Desk\Electronic Boards Info\Schedule Slides\2008\" + strMonthFull + "\" + strDay + " " + strMonthAbb + " " + txtYear.Text + ".ppt"
  12. End Sub
  13.  
  14. Private Sub Form_Load()
  15. Page1.SetFocus
  16. Dim str01 As String
  17. Dim str02 As String
  18. Dim str03 As String
  19. Dim str04 As String
  20. Dim str05 As String
  21. Dim str06 As String
  22. Dim str07 As String
  23. Dim str08 As String
  24. Dim str09 As String
  25. Dim str10 As String
  26. Dim str11 As String
  27. Dim str12 As String
  28. Dim str13 As String
  29. Dim str14 As String
  30. Dim str15 As String
  31. Dim str16 As String
  32. Dim str17 As String
  33. Dim str18 As String
  34. Dim str19 As String
  35. Dim str20 As String
  36. Dim str21 As String
  37. Dim str22 As String
  38. Dim str23 As String
  39. Dim str24 As String
  40. Dim str25 As String
  41. Dim str26 As String
  42. Dim str27 As String
  43. Dim str28 As String
  44. Dim str29 As String
  45. Dim str30 As String
  46. Dim str31 As String
  47. Dim strMonthFull As String
  48. Dim strMonthAbb As String
  49. Dim strDay As String
  50.  
  51. End Sub
  52. Private Sub txtYear_click()
  53. txtYear.MaxLength = 2
  54. If txtYear = "" Then
  55. MsgBox "Please enter a year"
  56. txtYear.SetFocus
  57. End Sub
  58. Private Sub cmdGo_Click()
  59. End Sub
  60.  
  61. Private Sub opt1_Click()
  62. If opt1.Value = True Then
  63. str01 = "01"
  64. str01 = strDay
  65. End If
  66. End Sub
  67. Private Sub opt2_Click()
  68. If opt2.Value = True Then
  69. str02 = "02"
  70. str01 = strDay
  71. End If
  72. End Sub
  73. Private Sub opt3_Click()
  74. If opt2.Value = True Then
  75. str03 = "03"
  76. str03 = strDay
  77. End Sub
  78. Private Sub opt4_Click()
  79. If opt4.Value = True Then
  80. str04 = "04"
  81. str04 = strDay
  82. End If
  83. End Sub
  84. Private Sub opt5_Click()
  85. If opt5.Value = True Then
  86. str05 = "05"
  87. str05 = strDay
  88. End If
  89. End Sub
  90. Private Sub opt6_Click()
  91. If opt6.Value = True Then
  92. str06 = "06"
  93. str06 = strDay
  94. End Sub
  95. Private Sub opt7_Click()
  96. If opt7.Value = True Then
  97. str07 = "07"
  98. str07 = strDay
  99. End If
  100. End Sub
  101. Private Sub opt8_Click()
  102. If opt8.Value = True Then
  103. str08 = "08"
  104. str08 = strDay
  105. End If
  106. End Sub
  107. Private Sub opt9_Click()
  108. If opt9 = True Then
  109. str09 = "09"
  110. str09 = strDay
  111. End If
  112. End Sub
  113. Private Sub opt10_Click()
  114. If opt10.Value = True Then
  115. str10 = "10"
  116. str10 = strDay
  117. End If
  118. End Sub
  119. Private Sub opt11_Click()
  120. If opt11.Value = True Then
  121. str11 = "11"
  122. str11 = strDay
  123. End If
  124. End Sub
  125. Private Sub opt12_Click()
  126. If opt11.Value = True Then
  127. str12 = "12"
  128. str12 = strDay
  129. End If
  130. End Sub
  131. Private Sub opt13_Click()
  132. If opt13.Value = True Then
  133. str13 = "13"
  134. str13 = strDay
  135. End If
  136. End Sub
  137. Private Sub opt14_Click()
  138. If opt14.Value = True Then
  139. str14 = "14"
  140. str14 = strDay
  141. End If
  142. End Sub
  143. Private Sub opt15_Click()
  144. If opt15.Value = True Then
  145. str15 = "15"
  146. str15 = strDay
  147. End If
  148. End Sub
  149. Private Sub opt16_Click()
  150. If opt16.Value = True Then
  151. str16 = "16"
  152. str16 = strDay
  153. End If
  154. End Sub
  155. Private Sub opt17_Click()
  156. If opt17.Value = True Then
  157. str17 = "17"
  158. str17 = strDay
  159. End If
  160. End Sub
  161. Private Sub opt18_Click()
  162. If opt18.Value = True Then
  163. str18 = "18"
  164. str18 = strDay
  165. End If
  166. End Sub
  167. Private Sub opt19_Click()
  168. If opt19.Value = True Then
  169. str19 = "19"
  170. str19 = strDay
  171. End If
  172. End Sub
  173. Private Sub opt20_Click()
  174. If opt20.Value = True Then
  175. str20 = "20"
  176. str20 = strDay
  177. End If
  178. End Sub
  179. Private Sub opt21_Click()
  180. If opt21.Value = True Then
  181. str21 = "21"
  182. str21 = strDay
  183. End If
  184. End Sub
  185. Private Sub opt22_Click()
  186. If opt22.Value = True Then
  187. str22 = "22"
  188. str22 = strDay
  189. End If
  190. End Sub
  191. Private Sub opt23_Click()
  192. If opt23.Value = True Then
  193. str23 = "23"
  194. str23 = strDay
  195. End If
  196. End Sub
  197. Private Sub opt24_Click()
  198. If opt24.Value = True Then
  199. str24 = "24"
  200. str24 = strDay
  201. End If
  202. End Sub
  203. Private Sub opt25_Click()
  204. If opt25.Value = True Then
  205. str25 = "25"
  206. str25 = strDay
  207. End If
  208. End Sub
  209. Private Sub opt26_Click()
  210. If opt26.Value = True Then
  211. str26 = "26"
  212. str26 = strDay
  213. End If
  214. End Sub
  215. Private Sub opt27_Click()
  216. If opt27.Value = True Then
  217. str27 = "27"
  218. str27 = strDay
  219. End If
  220. End Sub
  221. Private Sub opt28_Click()
  222. If opt28.Value = True Then
  223. str28 = "28"
  224. str28 = strDay
  225. End If
  226. End Sub
  227. Private Sub opt29_Click()
  228. If opt29.Value = True Then
  229. str29 = "29"
  230. str29 = strDay
  231. End If
  232. End Sub
  233. Private Sub opt30_Click()
  234. If opt30.Value = True Then
  235. str30 = "30"
  236. str30 = strDay
  237. End If
  238. End Sub
  239. Private Sub opt31_Click()
  240. If opt31.Value = True Then
  241. str31 = "31"
  242. str31 = strDay
  243. End If
  244. End Sub
  245.  
  246. Private Sub optAirfield_Click()
  247.  lblLink = "\\yofs13\374OG\36AS\Asgard_data\data\Duty Desk\Electronic Boards Info\Schedule Slides\2008\INFO & STATUS\Info And Status.ppt"
  248.  lblLink = lblLink.Caption
  249. End Sub
  250. Private Sub optJan_Click()
  251. If optJan.Value = True Then
  252. strMonthFull = "JANUARY"
  253. strMonthAbb = "JAN"
  254. End If
  255. End Sub
  256. Private Sub optFeb_Click()
  257. If optFeb.Value = True Then
  258. strMonthFull = "FEBRUARY"
  259. strMonthAbb = "FEB"
  260. End If
  261. End Sub
  262. Private Sub optMar_Click()
  263. If optMar.Value = True Then
  264. strMonthFull = "MARCH"
  265. strMonthAbb = "MAR"
  266. End If
  267. End Sub
  268. Private Sub optApr_Click()
  269. If optApr.Value = True Then
  270. strMonthFull = "APRIL"
  271. strMonthAbb = "APR"
  272. End If
  273. End Sub
  274. Private Sub optMay_Click()
  275. If optMay.Value = True Then
  276. strMonthFull = "MAY"
  277. strMonthAbb = "MAY"
  278. End If
  279. End Sub
  280. Private Sub optJun_Click()
  281. If optJun.Value = True Then
  282. strMonthFull = "JUNE"
  283. strMonthAbb = "JUN"
  284. End If
  285. End Sub
  286. Private Sub optJul_Click()
  287. If optJul.Value = True Then
  288. strMonthFull = "JULY"
  289. strMonthAbb = "JUL"
  290. End If
  291. End Sub
  292. Private Sub optAug_Click()
  293. If optAug.Value = True Then
  294. strMonthFull = "AUGUST"
  295. strMonthAbb = "AUG"
  296. End If
  297. End Sub
  298. Private Sub optSep_Click()
  299. If optSep.Value = True Then
  300. strMonthFull = "SEPTEMBER"
  301. strMonthAbb = "SEP"
  302. End If
  303. End Sub
  304. Private Sub optOct_Click()
  305. If optOct.Value = True Then
  306. strMonthFull = "OCTOBER"
  307. strMonthAbb = "OCT"
  308. End If
  309. End Sub
  310. Private Sub optNov_Click()
  311. If optNov.Value = True Then
  312. strMonthFull = "NOVEMBER"
  313. strMonthAbb = "NOV"
  314. End If
  315. End Sub
  316. Private Sub optDec_Click()
  317. If optDec.Value = True Then
  318. strMonthFull = "DECEMBER"
  319. strMonthAbb = "DEC"
  320. End If
  321. End Sub
  322. Private Sub optSched_Click()
  323.  lblLink.Caption = "\\yofs13\374OG\36AS\Asgard_data\data\Duty Desk\Electronic Boards Info\Schedule Slides\2008\"
  324.  End Sub
  325.  
[
Aug 4 '08 #1
1 1072
risk32
98
At the very least, with the code I'm trying to create, there will be 365 possible links available. I've even tried using variables (ie. varDay, varMonthFull, varMonthAbb) and the only thing that shows with the link is the Airfield and Schedule main caption with the first radio buttons. It would probably help if I could include pictures with it to show what I'm looking at, but I'm not exactly sure how to do that with this forum.
Aug 6 '08 #2

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

Similar topics

163
by: Shiperton Henethe | last post by:
Hi Know any good utilities to help me strip out the tags that Microsoft Excel 2002 leaved behind when you try and export an HTML format file? This is driving me NUTS. And really makes me...
8
by: frankvfox | last post by:
I am struggling to export Excel spreadsheets to the client machine in an ASP.Net application. Everything was great until exporting Excel got into the act. Documentation on MSDN is so poor regarding...
5
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but...
6
by: ©pEIO | last post by:
I have installed the PIA of Microsoft Office 2003 and the installation was succefully. If I add the reference of Microsoft Excel 11.0, I see that the property CopyLocal is False and the assembly...
3
by: ©pEIO | last post by:
Example: Dim xlsExcel As Excel.Application Dim wkbExcel As Excel.Workbook Dim wksExcel As Excel.Worksheet xlsExcel = New Excel.Application wkbExcel = xlsExcel.Workbooks.Open("C:\Test.xls")...
4
by: Irfan | last post by:
hi, Two questions, i dont know if the cause if these two problems is the same. 1. As soon as i Add->Reference -> Microsoft Excel 11.0 Object library. It gives an error 'The referenced...
5
by: C# newbie with big problems | last post by:
Ok, I've tried everything I could come up with but nothing is working. I am creating an application which needs to post information into an excel document. I have not yet had a chance to play with...
0
by: Thanks | last post by:
I would like to output a dataset to excel from a text file but did not work. I alreay add the microsoft active component 2.7 and 2.8 and microsoft excel 11 component library but no luck. Please...
5
by: Michael Russell | last post by:
Hi all, Using C#, I've created a simple wrapper class for using Excel. I have Office Pro 2003 installed on my devel machine. The wrapper class works great, reading and writing to/from Excel. ...
8
by: rssd | last post by:
can somebody help me. I'm trying to read some excel files but i'm always getting this error No type library matching "Microsoft Excel" found at D:\Genes_datasets\exp.pl line 4 Win32::OLE(0.16):...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.