Option Explicit Dim mdl ' the current model Set mdl = ActiveModel If (mdl Is Nothing) Then MsgBox "There is no Active Model" End If Dim HaveExcel Dim RQ RQ = vbYes 'MsgBox("Is Excel Installed on your machine ?", vbYesNo + vbInformation
Sub ReadDBData() On Error GoTo ErrorHand Dim dbHelper As New dbHelper Dim sqlSQL As String Dim rs As ADODB.Recordset Dim row As Integer If dbHelper.OpenConnection(GetConnString()) Then sqlSQL = "select top(500) * from View_Column" Set rs = dbHel
Sub GetData() Dim strConn As String, strSQL As String Dim conn As ADODB.Connection Dim ds As ADODB.Recordset Dim col As Integer '清空电子表格的所有数据 Cells.Clear '连接数据库的字符串 strConn = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=name;Password=pwd;In
1. 将 互换 Excel 列号(数字/字母) Public Function excelColumn_numLetter_interchange(numOrLetter) As String Dim i, j, idx As Integer Dim letterArray letterArray = Array("A", "B", "C", "D", "E", "F", "G
Compile Error: The code in this project must be updated for use on64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute. 1.问题: 32-bit的VBA程序,在64-bit系统上运行时,出现该编译错误. 环境:Office2010 Excel 64-bit, 64-bit
昨天下午开始学习的vba,累死了,肯定有bug,待调试 vba程序如下: Dim aSum As Integer Dim tSum As Integer ) As Integer Dim arrMax As Integer Dim arr ) As Integer Function Test() Dim arrWmax As Integer Dim Rng As Range Dim beginRow As Integer Dim beginLine As Integer ) rr = Rng.A
# -*- coding: utf-8 -*- """ Created on Thu Mar 06 11:22:03 2014 @author: Administrator """ import win32com.client from win32com.gen_py import msof,mspp,msxl from string import uppercase from pandas import Series #%% 将常量发布到全局命
1.安装数据库 2.创建数据源 Private Sub Worksheet_Change(ByVal Target As Range) Then Call mySQL End If End Sub Public Function mySQL() strconnt = "" Set connt = CreateObject("ADODB.Connection") Dim sevip, Db, user, pwd As String '设服务器地址 所连数据,及登录用户
PostgreSql: 第一步 在网上下载postres的驱动程序,之后安装,下载地址:https://www.devart.com/odbc/postgresql/download.html 第二步 创建ODBC数据源 点击“开始->控制面板->管理工具->数据源(ODBC)->用户DSN->添加” 安装上图配置好之后写入VBA代码并导入包文件 Private Sub CommandButton1_Click() Dim cnn As New ADODB.Connectio
Sub Md() ' ' Macro1 Macro ' 宏由 BX 录制,时间: 2012-6-8 ' 宏中的列数可以输入 A - IV 也可以输入 1-256 ' Dim i%, j%, i1%, j1%, i2%, j2% myi = UCase(InputBox("第一列")) myj = UCase(InputBox("第二列")) ' '************************************ If myi Like "[A-Z]
1. 引用 API 函数 ' API函数Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String) As LongPublic Declare Function ShowWindow Lib "user32" ( _ ByVal hwnd As